public void onHTTPRequest(IVHost vhost, IHTTPRequest req, IHTTPResponse resp) {
String app = “live”;
String streamName = “test1.stream”;//test.stream is active
if (params.containsKey(“app”))
app = params.get(“app”).get(0);
if (params.containsKey(“stream”))
streamName = params.get(“stream”).get(0);
IApplicationInstance appInstance = vhost.getApplication(app).getAppInstance(“definst ”);
Stream stream = (Stream)appInstance.getProperties().getProperty(streamName);
java.util.List itemList=stream.getPlaylist();
///////
i want to get playlist, but stream is null forever.how to get live stream ?
please help me. thanks.
INFO stream create - -
WARN server comment - Publisher.publish: Stream name already in use: test1.stream
INFO stream publish test1.stream -
1111
December 17, 2014, 12:34pm
4
The Stream class is used for server-side streams. It implements the IMediaStream interface but a IMediaStream is not necessarily a Stream.
You can do this:
IMediaStream stream = appInstance.getStreams().getStream(streamName);
If you want to use the Stream class you will need to do your own server side-publishing. You can then point your Stream to a live stream using Stream.play(liveStreamName, -2, -1, true)
Check out this article:
https://www.wowza.com/docs/how-to-do-basic-server-side-publishing-with-stream-class-streams