media.paused && media.dispatchEvent( 'loadeddata' );
};
- options.controls = +options.controls === 0 || +options.controls === 1 ? options.controls : 1;
+ options.controls = +options.controls === 0 || +options.controls === 1 ? options.controls : 1;
options.annotations = +options.annotations === 1 || +options.annotations === 3 ? options.annotations : 1;
flashvars = {
src = /^.*[\/=](.{11})/.exec( media.src )[ 1 ];
- swfobject.embedSWF( "http://www.youtube.com/e/" + src + "?enablejsapi=1&playerapiid=" + container.id + "&version=3",
+ swfobject.embedSWF( "http://www.youtube.com/e/" + src + "?enablejsapi=1&playerapiid=" + container.id + "&version=3",
container.id, media.offsetWidth, media.offsetHeight, "8", null,
flashvars, params, attributes );
};
events[ evtName ] = [];
}
-
+
events[ evtName ].push( fn );
return fn;
};
-
+
// Can take event object or simple string
basePlayer.dispatchEvent = function( oEvent ) {
self = this,
eventInterface,
eventName = oEvent.type;
-
+
// A string was passed, create event object
if ( !eventName ) {
eventName = oEvent;
eventInterface = Popcorn.events.getInterface( eventName );
-
+
if ( eventInterface ) {
evt = document.createEvent( eventInterface );
evt.initEvent( eventName, true, true, window, 1 );
}
}
-
+
Popcorn.forEach( events[ eventName ], function( val ) {
val.call( self, evt, self );