Skip to content

Commit

Permalink
Change to add additional checks to more accurately represent the curr…
Browse files Browse the repository at this point in the history
…ent state of the instream player. This makes it so that we're more certain that we're in the before play state when we set the instream to playing after the video plays. This fixes an issue with the chrome cast where a video with a postroll l will replay at the end of the video [Fixes #89206786]
  • Loading branch information
jw-kaurand committed Mar 2, 2015
1 parent feff961 commit 860d15e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/html5/jwplayer.html5.instream.js
Expand Up @@ -74,7 +74,7 @@
// Keep track of the original player state
_oldpos = _video.currentTime;

if (_controller.checkBeforePlay() || _oldpos === 0) {
if ( (_controller.checkBeforePlay() || _oldpos === 0) && !_model.getVideo().checkComplete()) {

This comment has been minimized.

Copy link
@robwalch

robwalch Mar 2, 2015

Contributor

I might be splitting hairs here. I just think the before and complete cases are exclusive and the latter is only a workaround so if we could remove the workaround we'd take out that check and the _oldpos state var.

if ( _controller.checkBeforePlay() || (_oldpos === 0 && !_model.getVideo().checkComplete())) { ?

This comment has been minimized.

Copy link
@jw-kaurand

jw-kaurand Mar 3, 2015

Author Contributor

That seems fine and it works the same in the test cases I was looking at. We have to maintain the _oldpos var though since its used later to seek to the correct part of the video that was interrupted when we destroy the instream

// make sure video restarts after preroll
_oldpos = 0;
_oldstate = _states.PLAYING;
Expand Down

0 comments on commit 860d15e

Please sign in to comment.