dealing with dynamic playlists
Hola,
This topic I'm sure has been brought up several times, but I want to additionally add in some more technical questions.
I want to first clarify that I'm primarily using the flash player rather than HTML5, as I'm streaming with HLS.
Also wanting to clarify some differentiations with how jwplayer handles internal events. I'm assuming with the HTML5 player, event dispatching is more explicit, whereas when sending javascript events to the flash player, events get queued up, and then dispatched to the flashplayer somehow? Is this a correct assumption?
__That's my preface, here's the question:__
I made a music player, initially the player doesn't need to play anything until the user decides to play a track from a list of tracks. jwplayer doesn't function with subsequent load()'s if setup() doesn't initially load one (this is seemingly a known "fact")
my solution: load in a dummy track: (syntax highlighted code: https://gist.github.com/moimikey/f2539c262292230e2e83)
```
@player = jwplayer?(@ui.player[0]).setup
playlist: [
title: 'you taste like sunshine dust' # magic key to not fire buffering trigger on start
file: '/assets/audio/dummy.m3u8' # necessary to allow subsequent load()'s. jwplayer bug.
]
```
okay, I load in this dummy track, so I can toy around with this playlist. now, I don't want to load() a new playlist, but instead, remove that dummy track, and append new objects.
I've read people attempting this: (take into consideration that @player === jwplayer('selector')) [gist: https://gist.github.com/moimikey/00a60f50f30de3ed9dbf]
```
playlist = [{ track }, { track }, { track }, ...]
@player.getPlaylist().push(playlist)
```
That won't do anything of any use except create a new instance which I can subsequently use with load(). I don't want to do it... I want to APPEND tracks, not replace.
I looked at Trac, went to that method specifically, and saw that it triggers _callInternal('jwGetPlaylist'). Since I'm dealing with a flash player here, I don't think I would even have access to whatever array it's utilizing to store these tracks? I dug a little through the jwplayer instance and saw stuff in jwplayer.config.playlist, but if I alter that, nothing gets propagated, so that's no dice as well.
Is there a better solution for ALTERING an already loaded playlist rather than having to flush it with a new playlist? Maybe some internal methods or hacky event triggers I can attempt?
Thanks!