Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
[#958] make sure start time is never less than 0.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottDowne committed Mar 22, 2012
1 parent 2e79edd commit f826051
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions popcorn.js
Expand Up @@ -263,6 +263,16 @@
// function to fire when video is ready
var isReady = function() {

// chrome bug: http://code.google.com/p/chromium/issues/detail?id=119598
// it is possible the video's time is less than 0
// this has the potential to call track events more than once, when they should not
// start: 0, end: 1 will start, end, start again, when it should just start
// just setting it to 0 if it is below 0 fixes this issue
if ( self.media.currentTime < 0 ) {

self.media.currentTime = 0;
}

self.media.removeEventListener( "loadeddata", isReady, false );

var duration, videoDurationPlus;
Expand Down

0 comments on commit f826051

Please sign in to comment.