Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Adding to / removing from a playlist without stopping playback.


Hello,

I am trying to use JWPlayer javascript API to create a playlist for playing audio files. The system will be used primarily on mobile. That is important, because most mobile platforms do not allow javascript to start the playback of a mediafile without a user directly initiating this.

In short, that means that I can not trigger playback of a new audio-file when the previous has completed- I have to make use of a playlist to accomplish this. However, as it is right now I don't think it's possible to add items to or remove them from a playlist without stopping playback.

Are there any solutions to this?

7 Community Answers

jherrieven

User  
0 rated :

This might be of interest:

http://dev.powered-by-haiku.co.uk/solutions/listy/

James Herrieven

goctionni

User  
0 rated :

That does look quite useful, though I'm looking to deal with the UI elements myself and I can't really see any documentation there for a pure js API without a directly linked visual representation (I'd rather take care of that myself).

It doesn't look like Listy has support for that?

jherrieven

User  
0 rated :

Ah ok.

Although it does currently have some of it's own API functions in place (such as adding, removing, search, shuffle etc), and these have both UI and non-UI specific implementations, they have not been documented yet as the API is not complete.

I'm looking at cutting a new version with a completed API around mid-to-late April.

This version will also have richer "Add from YouTube" and "Add from Soundcloud" capabilities, along with the ability to merge playlists from multiple sources.

I'm not sure whether this suits with your timeline, but I'd be happy to consider any specific API calls you might wish to have included as part of this development phase.

James Herrieven

Todd

JW Player Support Agent  
0 rated :

The playlist is basically just a Javascript object that can be manipulated outside of the player and then loaded back via the load() call. Just make sure you’re loading a slice(0) of your playlist and not the actual playlist.

I’m not sure if this applies perfectly to your scenario with audio on mobile, but check out http://qa.jwplayer.com/~todd/playlist-append.html

goctionni

User  
0 rated :

The problem with what you suggest is that calling .load() stops playback.

goctionni

User  
0 rated :

Seems I can't edit the previous comment, so; adding to that previous comment:

This is what the linked page says:

"I am using the Javascript API call jwplayer().onPlaylistItem() to compare the contents of the original Javascript array to the playlist that is currently loaded. If the playlist outside of the player is different, I wait until the current video is over, load the new playlist, then begin playback with the video that the previous playlist was going to play."

That won't work on mobile. You can't open the new playlist and automatically start playing- because the playing won't have been triggered by a user click.

Todd

JW Player Support Agent  
0 rated :

I haven’t tested this, but does the user still need to click something if you load the new playlist inside of an onPlaylistComplete() API event?

How about you load ~10 audio tracks or so on the first playlist and then use an “Are you still listening?” dialog box as the trigger to load a new playlist?

This question has received the maximum number of answers.