Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function isPlayable( obj, tracksBy, index ) {
- var natives = tracksBy[ index ]._natives;
- if ( !natives ||
- ( !!Popcorn.registryByName[ natives.type ] || !!obj[ natives.type ] ) ) {
- return true;
- }
- return false;
- }
- function isAllowed( obj, trackEvent, which, currentTime ) {
- if ( trackEvent[ which ] > currentTime &&
- trackEvent._running === false &&
- obj.data.disabled.indexOf( trackEvent._natives.type ) === -1 ) {
- return true;
- }
- return false;
- }
- function playTrackEvent( obj, event, trackEvent, which, state ) {
- var method;
- if ( trackEvent._natives ) {
- method = trackEvent._natives[ which ];
- trackEvent._running = state;
- if ( method ) {
- method.call( obj, event, trackEvent );
- }
- }
- return trackEvent;
- }
- function playIfAllowed( opts ) {
- if ( isAllowed( opts.instance, opts.trackEvent, opts.which, opts.currentTime ) ) {
- playTrackEvent( opts.instance, opts.event, opts.trackEvent, opts.which, opts.state );
- }
- }
Add Comment
Please, Sign In to add comment