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

Adding new videos to the list at runtime #99

Open
rohitashokkhot opened this issue Apr 13, 2018 · 4 comments
Open

Adding new videos to the list at runtime #99

rohitashokkhot opened this issue Apr 13, 2018 · 4 comments

Comments

@rohitashokkhot
Copy link

Hi,
A basic question/query.
how can I add new videos to the playlist at runtime?
Is there any function like player.playlist.add()?

Thanks in advance

@yucolabjames
Copy link

Am looking for the same function, am wondering if updating the video array will work?

Have you found a way since then?

@albe
Copy link

albe commented Jul 10, 2019

const myPlaylist = [...];
player.playlist(myPlaylist);
...
myPlaylist.push(myNextVideo);
player.playlist(myPlaylist, -1);

should do the trick. The current playing item will not be changed with the -1 parameter, but ofc this might behave weird if you change the item at the current position in myPlaylist (ie. remove items or reorder). Should have no issues with just appending though.

@HariShankarS
Copy link

Thanks @albe This works.

@tulkas85
Copy link

this work for add at runtume, but how remove item played ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants