When handling onStreamDestroy for an IMediaStream where isPlay() returns true, is there a way to shut down/disconnect the stream such that the publisher will stop sending video?
I tried looping through the streams and shutting down all with a matching name like this:
List<IMediaStream> streams = mediaStream.getStreams().getStreams();
for (IMediaStream stream : streams) {
if (stream.getName().equals(mediaStream.getName())) {
getLogger().info("[DVS] Closing stream - " + dumpStream(stream));
stream.close();
}
}
Afterward, the log said:
INFO stream stop kGwBRB-msUOWDRgNwvMEyw.sdp -
INFO server comment - [DVS] onStreamDestroy - name: kGwBRB-msUOWDRgNwvMEyw.sdp,
type: live-lowlatency, direction: player
INFO server comment - [DVS] Closing stream - name: kGwBRB-msUOWDRgNwvMEyw.sdp, t
ype: live-lowlatency, direction: source
INFO server comment - [DVS] Closing stream - name: kGwBRB-msUOWDRgNwvMEyw.sdp, t
ype: live-lowlatency, direction: player
INFO stream destroy kGwBRB-msUOWDRgNwvMEyw.sdp -
INFO session disconnect 1041852817 -
However, I continued to get data coming to Wowza from the video source (observed by sniffing traffic), so I guess this isn’t the right way to do it.
If I’m shutting Wowza down, I notice that streaming stops when this is written to the log:
INFO rtsp disconnect 284155326 -
This is maybe a funny way of asking, but is there a path through the API from IMediaStream that will cause the rtsp disconnect?
Thanks,
Eric