Fix: Poster hidden when item index > 0 #260
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Changes in #243 prevent poster "flashing" in auto-advance scenarios but introduces a new issue whereby posters are hidden if the playlist is set to an item index of > 0, whether or not it's auto-advancing. The v6 major rewrite does address this problem however it may be some time before existing integrations can be fully tested with and migrated to v6. As an interim measure, these relatively minor changes take the idea of a parameter from v6 and implement it against the v5 codebase.
To reproduce the issue, checkout the v5.1.0 tag. Before running
npm start
, inindex.html
change the URL for the poster of the second item in the playlist from 'http://www.videojs.com/img/poster.jpg' (this is a 404) to 'http://vjs.zencdn.net/v/oceans.png'.run
npm start
Visit
http://localhost:9999/
in the browser dev-tools console, enter
player.playlist.next()
. Observe that no poster is visible. Verify thatplayer.poster_
shows a value of''
.To manually test these changes, checkout this branch.
No need to update
index.html
:)Visit
http://localhost:9999/
in the browser dev-tools console, enter
player.playlist.next()
. Observe that the poster is visible andplayer.poster_
shows a value ofhttp://vjs.zencdn.net/v/oceans.png
.We can verify that posters are still suppressed in an auto-advance setup by setting the auto-advance to a value in the UI on the test page and letting the playlist play in Chrome or Firefox. No poster flashes should be observed.
Specific Changes proposed
suppressPoster
param toplayItem
,playlist.currentItem
andplaylist.next
. The parameter defaults to false.true
when callingplaylist.next
inautoadvance.setup
fixes #253
Requirements Checklist