Skip to content
This repository was archived by the owner on Jun 29, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions popcorn.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
});
};

Expand Down
8 changes: 4 additions & 4 deletions test/popcorn.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down