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

Commit

Permalink
Merge pull request #18 from ScottDowne/t958
Browse files Browse the repository at this point in the history
[#958] make sure start time is never less than 0.
  • Loading branch information
dseif committed Mar 23, 2012
2 parents 3e0da2e + f826051 commit a248972
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions popcorn.js
Expand Up @@ -213,6 +213,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 a248972

Please sign in to comment.