Copy link to clipboard
Copied
Hi all
I have created an xml playlist to play a live stream first, and I have a 2nd playlist item, which is an on demand video, which I want to start playing should the live stream dropout.
At the moment if the livestream stops the player just tries to rebuffer it and won't move onto the 2nd playlist item. Does anyone know how I can get the playlist to start playing the on demand video?
The idea is to provide some back up so if there is a problem the viewer still gets some content. Ideally I would want to loop the playlist some how so that after the second playlist item finishes the livestream is tried again.
Any help with this would be greatly appreciated.
Thanks
Copy link to clipboard
Copied
Hi I dont know what exactly you mean by XML Playlist.But let me try to give simple example which might help you. Say you are playing a live stream and suddenly the live stream stops so you want to switch to on-demand video. This is very simple to achieve - What you have to do is define NetStream.onStatus handler and track various status messages in order to perform certain actions. In this case when liveStream stops, client should get "NetStream.Play.UnPublishNotify" indicating that live stream has stopped so it can issue play for on-demand video. When on-demand video is stopped, you can reissue play for live stream. But its better you also use NetStream.time property to check if its increasing to be sure that live stream is indeed playing - because when you issue play for live stream and there is none getting published at server , you will get NetStream.Play.Start and it will continue to wait for someone to publish stream by that name on the server. Hope this answers your question - do let me know if you have any more queries.