Popcorn.p[ key ] = Popcorn.events.fn[ key ];
});
- // Protected API methods
- Popcorn.protect = {
- natives: ( "load play pause currentTime playbackRate mute volume duration removePlugin roundTime trigger listen unlisten exec" +
- "preload playbackRate autoplay loop controls muted buffered readyState seeking paused played seekable ended" ).toLowerCase().split( /\s+/ )
- };
-
// Internal Only - Adds track events to the instance object
Popcorn.addTrackEvent = function( obj, track ) {
// alias for exec function
Popcorn.p.cue = Popcorn.p.exec;
+ // Protected API methods
+ Popcorn.protect = {
+ natives: Object.keys( Popcorn.p ).join( "," ).toLowerCase().split( "," )
+ };
+
// Exposes Popcorn to global context
global.Popcorn = Popcorn;
function plus() {
if ( ++count === expects ) {
start();
+ Popcorn.removePlugin( "cleanup" );
}
}
});
+test( "Protected Names", function() {
+ var keys = Object.keys( Popcorn.p ),
+ len = keys.length,
+ count = 0,
+ popped = Popcorn( "#video" );
+ expect( len );
-test("Protected Names", function() {
- //QUnit.reset();
-
- expect(8);
-
- var popped = Popcorn("#video");
+ function plus() {
+ if ( ++count === len ) {
+ start();
+ }
+ }
- $.each( "load play pause currentTime playbackRate mute volume duration".split(/\s+/), function(k, name) {
+ Popcorn.forEach( keys, function( name ) {
try {
- Popcorn.plugin( name, {});
- } catch (e) {
+ Popcorn.plugin( name, {} );
+ } catch ( e ) {
ok( name, "Attempting to overwrite '" + name + "' threw an exception " );
-
+ plus();
};
});
+
+ stop( 5000 );
+
});
test("Defaulting Empty End Values", function() {