Wowza Community

Please help, i need additional info about Wowza server-side API

I can’t find how to stop stream created from server side through class Stream, like this:

stream.play("mp4:" + recordingName, 0, -1, true);

When i do:

IMediaStream stream = applicationInstance.getStreams().getStream(streamName);
stream.close();

But stream still play.

I found some subjects about Stream and IMediaStream, and all of them without answer.

I created a topic How to stop stream created from server side

Please point me right way.

Hello there. Try it like this:

Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
stream.close();

Also, you might like to take a look at this module:

How to control Stream class streams dynamically (ModuleStreamControl)

Regards,

Salvadore

Great! Thanks for the update and glad to hear you got this sorted.

Salvadore

Hello there. Try it like this:

Stream stream = (Stream)client.getAppInstance().getProperties().getProperty(streamName);
stream.close();

Yes, i try this. Return error on this line:

stream.close();
ERROR	500	-	HTTPRequestAdapter.service : java.lang.NullPointerException|at ru.pixorama.HTTPTranslation.onHTTPRequest(HTTPTranslation.java:178)|at com.wowza.wms.http.HTTPRequestAdapter.service(HTTPRequestAdapter.java:33)|at com.wowza.wms.server.ServerHandler.a(ServerHandler.java:643)|at com.wowza.wms.server.ServerHandler.a(ServerHandler.java:375)|at com.wowza.wms.server.ServerHandler.messageReceived(ServerHandler.java:488)|	-	-	-	39.276	-	-	-	-	-	-	-	-	-	-	-	-	

Update:

Thanks, now working :slight_smile:

Just need put reference on stream to applicationInstance properties on stream creation.

Stream stream = Stream.createInstance(applicationInstance, streamID);
applicationInstance.getProperties().put(streamID, stream);
stream.play("mp4:" + recordingName, 0, -1, true);

And get this reference from applicationInstance when yo need to stop stream:

Stream stream = (Stream) applicationInstance.getProperties().getProperty(streamID);
stream.close();