Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load playlist with initial video at specified index or no starting video #38

Merged
merged 2 commits into from
Sep 12, 2016

Conversation

mister-ben
Copy link
Contributor

@mister-ben mister-ben commented Apr 8, 2016

Description

Allows the starting index of a playlist to be specified to load a video other than [0] into the player, or no video.
Use cases:

  • Playlists that should start on a "featured" item which is not first in the list
  • Facilitates direct linking
  • Playlists that do not include the content currently playing, e.g. related videos
  • Loaded new playlists without interrupting currently playback, e.g. a category tabs UI

Example: http://jsbin.com/diyove/edit?html,output

Specific Changes proposed

playlist() takes an additional Number argument for the starting index, defaulting to 0 if not specified. When the playlist is loaded currentItem() is used instead of first(). An index of -1 results in playlist loaded but no video from the playlist loaded into the player.

Requirements Checklist

  • Feature implemented / Bug fixed
  • If necessary, more likely in a feature request than a bug fix
  • Reviewed by Two Core Contributors

@mister-ben mister-ben changed the title Start at index Load playlist with initial video at specified index or no starting video Apr 21, 2016
@gkatsev
Copy link
Member

gkatsev commented Jun 17, 2016

LGTM.

@misteroneill misteroneill merged commit 606dfd1 into videojs:master Sep 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants