Jim,
- For vod playback you can join using this method, but it only works for Flash RTMP clients:
https://www.wowza.com/docs/how-to-insert-a-pre-roll-or-mid-roll-for-video-on-demand-playback-in-flash-rtmp-client
For live, you can join with Stream class streams, and this works across client types, and as input to the Wowza Transcoder and PushPublish. The scheduler is one example:
https://www.wowza.com/docs/how-to-schedule-streaming-with-wowza-streaming-engine-streampublisher
-
This is not supported using Wowza as far as I know.
-
I have used IMediaStream.setReceiveVideo(false) in IMediaStreamActionNotify3.onPlay() to control this in rtsp playback in VLC. I did not test on any mobile clients:
package test;
import com.wowza.util.IOPerformanceCounter;
import com.wowza.wms.amf.*;
import com.wowza.wms.application.*;
import com.wowza.wms.client.IClient;
import com.wowza.wms.module.*;
import com.wowza.wms.request.RequestFunction;
import com.wowza.wms.stream.*;
import com.wowza.wms.media.model.*;
public class ModuleSoundOnly extends ModuleBase
{
class StreamListener implements IMediaStreamActionNotify3
{
public void onMetaData(IMediaStream stream, AMFPacket metaDataPacket)
{
System.out.println("onMetaData[" + stream.getContextStr() + "]: " + metaDataPacket.toString());
}
public void onPauseRaw(IMediaStream stream, boolean isPause, double location)
{
System.out.println("onPauseRaw[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
}
public void onPause(IMediaStream stream, boolean isPause, double location)
{
System.out.println("onPause[" + stream.getContextStr() + "]: isPause:" + isPause + " location:" + location);
}
public void onPlay(IMediaStream stream, String streamName, double playStart, double playLen, int playReset)
{
stream.setReceiveVideo(false);
}
public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
{
System.out.println("onPublish[" + stream.getContextStr() + "]: isRecord:" + isRecord + " isAppend:" + isAppend);
}
public void onSeek(IMediaStream stream, double location)
{
System.out.println("onSeek[" + stream.getContextStr() + "]: location:" + location);
}
public void onStop(IMediaStream stream)
{
IOPerformanceCounter perf = stream.getMediaIOPerformance();
getLogger().info("OutBytesRate for " + stream.getName() + ": " + perf.getMessagesOutBytes());
}
public void onUnPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend)
{
System.out.println("onUnPublish[" + stream.getContextStr() + "]: streamName:" + streamName + " isRecord:" + isRecord + " isAppend:" + isAppend);
}
public void onCodecInfoAudio(IMediaStream stream,
MediaCodecInfoAudio codecInfoAudio) {
System.out.println("onCodecInfoAudio[" + stream.getContextStr() + " Audio Codec" + codecInfoAudio.toCodecsStr() + "]: ");
}
public void onCodecInfoVideo(IMediaStream stream,
MediaCodecInfoVideo codecInfoVideo) {
System.out.println("onCodecInfoVideo[" + stream.getContextStr() + " Video Codec" + codecInfoVideo.toCodecsStr() + "]: ");
}
}
public void play(IClient client, RequestFunction function,
AMFDataList params) {
IMediaStream stream = getStream(client, function);
String[] querystring = stream.getQueryStr().split("&");
String qs1 = querystring[0];
//stream.setReceiveVideo(false);
}
public void onStreamCreate(IMediaStream stream)
{
getLogger().info("onStreamCreate["+stream+"]: clientId:" + stream.getClientId());
IMediaStreamActionNotify2 actionNotify = new StreamListener();
WMSProperties props = stream.getProperties();
synchronized (props)
{
props.put("streamActionNotifier", actionNotify);
}
stream.addClientListener(actionNotify);
}
public void onStreamDestroy(IMediaStream stream)
{
getLogger().info("onStreamDestroy["+stream+"]: clientId:" + stream.getClientId());
IMediaStreamActionNotify2 actionNotify = null;
WMSProperties props = stream.getProperties();
synchronized (props)
{
actionNotify = (IMediaStreamActionNotify2) stream.getProperties().get("streamActionNotifier");
}
if (actionNotify != null)
{
stream.removeClientListener(actionNotify);
getLogger().info("removeClientListener: " + stream.getSrc());
}
}
}
Richard