Skip to content

Commit

Permalink
fix: Workaround for IE not seeking to exactly 0 during setup.
Browse files Browse the repository at this point in the history
  patch from mozilla#454
  • Loading branch information
Plou committed Aug 9, 2016
1 parent 8ae202a commit 41591c9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wrappers/youtube/popcorn.HTMLYouTubeVideoElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@

function onFirstPause() {
removeYouTubeEvent( "pause", onFirstPause );
if ( player.getCurrentTime() > 0 ) {
// IE sometimes refuses to seek to exactly 0.
var playerTime = player.getCurrentTime();
if ( playerTime > 0 && !( playerTime < 0.2 && !impl.seeking && playerState === YT.PlayerState.PAUSED ) ) {
setTimeout( onFirstPause, 0 );
return;
}
Expand All @@ -240,8 +242,8 @@
return;
}
addYouTubeEvent( "pause", onFirstPause );
player.seekTo( 0 );
player.pauseVideo();
player.seekTo( 0 );
}

function addYouTubeEvent( event, listener ) {
Expand Down

0 comments on commit 41591c9

Please sign in to comment.