In the following function of openPlaylistOnStream, I do not know how to handle exception. It assumes the stream/file in the playlist is available. But this is not always the case. I hope it will raise some exception when the file is deleted or the live stream is not published yet.
I did find that for a live stream, if it is not published yet, it will start playing once the live stream is published. But if it can raise some exception, I think developer may need that for some handling. For my case, the streaming just hangs on one frame of last static video and waits there. This is not good. I hope it continues playing the static video and alerts a warning that live streaming is not published yet. And for static video, the same. I have two sets of static video, one is uploaded by the customer, one is the system default. Customers usually forget their videos or deleted their videos, if I can detect an exception while opening playlist on stream, I will let the progam automatically switch to my system default, which is usually there.
What I am asking is that playlist.open(stream) will raise exceptions in one way or another. Please consider my requirement.
public void openPlaylistOnStream(IClient client, RequestFunction function, AMFDataList params) {
String streamName = getParamString(params, PARAM1);
String playlistName = getParamString(params, PARAM2);
Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
Playlist playlist = (Playlist)client.getAppInstance().getProperties().getProperty(playlistName);
playlist.open(stream);
}