setTimeout( function() {
self.timeupdate.call( self );
- }, 250 );
+ }, 50 );
},
// By default, assumes this.resource is a DOM Element
// Add an event listener to the object
addEventListener: function( evtName, fn ) {
- if ( !this._events[evtName] ) {
+ if ( !this._events[ evtName ] ) {
this._events[evtName] = [];
}
}
}
- Popcorn.forEach( this._events[eventName], function( val ) {
+ Popcorn.forEach( this._events[ eventName ], function( val ) {
val.call( self, evt, self );
});
},
if ( elem.currentStyle ) {
// IE syntax
- return elem.currentStyle[prop];
+ return elem.currentStyle[ prop ];
} else if ( global.getComputedStyle ) {
// Firefox, Chrome et. al
return doc.defaultView.getComputedStyle( elem, null ).getPropertyValue( prop );
} else {
// Fallback, just in case
- return elem.style[prop];
+ return elem.style[ prop ];
}
}
};
stop( 10000 );
Popcorn.forEach( members, function ( type, prop ) {
- ok( typeof player[prop] === type, "player." + prop + " is type: " + type );
+ ok( typeof player[ prop ] === type, "player." + prop + " is type: " + type );
plus();
});
});
}
}
- player._resource = document.getElementById('player_1');
+ player._resource = document.getElementById( 'player_1' );
dimensions = player.getBoundingClientRect();
Popcorn.forEach( expectedVals, function() {
- expects+= 2;
+ expects += 2;
});
expect( expects );
stop( 1000 );
Popcorn.forEach( expectedVals, function( val, prop ) {
- equals( player.getStyle( prop ), val+'px', "Style '" + prop + "' correctly got" );
+ equals( player.getStyle( prop ), val + 'px', "Style '" + prop + "' correctly got" );
plus();
equals( dimensions[prop], val, "Bounding Client " + prop + " works" );
}
}
- expect(expects);
+ expect( expects );
stop( 4000 );
Popcorn.extend( player, {
plus();
// Must dispatch event so event listeners can work!
- this.dispatchEvent("timeupdate");
+ this.dispatchEvent( "timeupdate" );
// We don't want to cue custom timing loop using setTimeout because we only want this to run once
}
});
popcorn = Popcorn( playerForPopcorn )
- .exec( 2, function() {
- ok( Math.abs(player2.currentTime() - playerForPopcorn.currentTime) < 0.2, "Time update is within a reasonable range" );
- plus();
- ok( true, "Exec triggereed from popcorn after 2 seconds" );
- plus();
- });
+ .exec( 2, function() {
+ ok( Math.abs( player2.currentTime() - playerForPopcorn.currentTime ) < 0.2, "Time update is within a reasonable range" );
+ plus();
+ ok( true, "Exec triggereed from popcorn after 2 seconds" );
+ plus();
+ });
player.load();
player2.play();