Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

[#959367] Ensure duration changes pot the padding event at duration plus... #367

Open
wants to merge 2 commits into from

1 participant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 14, 2014
  1. @ScottDowne
  2. @ScottDowne

    r

    ScottDowne authored
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 8 deletions.
  1. +5 −4 popcorn.js
  2. +4 −4 test/popcorn.unit.js
View
9 popcorn.js
@@ -253,6 +253,7 @@
if ( !self.isDestroyed ) {
self.data.durationChange = function() {
var newDuration = self.media.duration,
+ newDurationPlus = newDuration + 1,
byStart = self.data.trackEvents.byStart,
byEnd = self.data.trackEvents.byEnd;
@@ -279,13 +280,13 @@
// References to byEnd/byStart are reset, so accessing it this way is
// forced upon us.
self.data.trackEvents.byEnd.push({
- start: newDuration,
- end: newDuration
+ start: newDurationPlus,
+ end: newDurationPlus
});
self.data.trackEvents.byStart.push({
- start: newDuration,
- end: newDuration
+ start: newDurationPlus,
+ end: newDurationPlus
});
};
View
8 test/popcorn.unit.js
@@ -1050,10 +1050,10 @@ asyncTest( "durationchange", 7, function() {
equal( byStart.length, 2, "byStart should only contain the padding trackevents" );
equal( byEnd.length, 2, "byEnd should only contain the padding trackevents" );
- ok( byStart[ 1 ].end === 10, "Padding event value should be equal to new duration. byStart.end" );
- ok( byStart[ 1 ].start === 10, "Padding event value should be equal to new duration. byStart.start" );
- ok( byEnd[ 1 ].end === 10, "Padding event value should be equal to new duration. byEnd.end" );
- ok( byEnd[ 1 ].start === 10, "Padding event value should be equal to new duration. byEnd.start" );
+ ok( byStart[ 1 ].end === 11, "Padding event value should be equal to new duration. byStart.end" );
+ ok( byStart[ 1 ].start === 11, "Padding event value should be equal to new duration. byStart.start" );
+ ok( byEnd[ 1 ].end === 11, "Padding event value should be equal to new duration. byEnd.end" );
+ ok( byEnd[ 1 ].start === 11, "Padding event value should be equal to new duration. byEnd.start" );
Popcorn.removePlugin( "durationPlugin" );
pop.destroy();
Something went wrong with that request. Please try again.