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, in index.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 that player.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 and player.poster_ shows a value of http://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
Add suppressPoster param to playItem, playlist.currentItem and playlist.next. The parameter defaults to false.
Set the parameter as true when calling playlist.next in autoadvance.setup
fixes #253
Requirements Checklist
[x] Feature implemented / Bug fixed
[ ] If necessary, more likely in a feature request than a bug fix
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'. runnpm start
Visithttp://localhost:9999/
in the browser dev-tools console, enterplayer.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
:) Visithttp://localhost:9999/
in the browser dev-tools console, enterplayer.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