All I want to do is intercept the http stream and play alias requests like we do for rtsp/rtmp
Richard,
Use IMediaStreamNameAliasProvider2
package com.wowza.wms.example.module;
com.wowza.wms.example.module.ModuleStreamNameAliasExample
import com.wowza.wms.application.*;
import com.wowza.wms.client.IClient;
import com.wowza.wms.httpstreamer.model.IHTTPStreamerSession;
import com.wowza.wms.mediacaster.IMediaCaster;
import com.wowza.wms.module.*;
import com.wowza.wms.rtp.model.RTPSession;
import com.wowza.wms.stream.IMediaStream;
import com.wowza.wms.stream.IMediaStreamNameAliasProvider2;
import com.wowza.wms.stream.livepacketizer.ILiveStreamPacketizer;
public class ModuleStreamNameAliasFull extends ModuleBase implements IMediaStreamNameAliasProvider2 {
public void onAppStart(IApplicationInstance appInstance) {
String fullname = appInstance.getApplication().getName() + "/"
+ appInstance.getName();
getLogger().info("onAppStart: " + fullname);
appInstance.setStreamNameAliasProvider(this);
}
public String resolvePlayAlias(IApplicationInstance appInstance,
String name, IClient client) {
getLogger().info("Resolve Play Flash: " + name);
IMediaStream stream = appInstance.getStreams().getStream(name);
if (client.getIp().equals("127.0.0.1"))
{
name="mp4:Extremists.m4v";
}
stream.getProperties().setProperty("foo", "bar");
return name;
}
public String resolvePlayAlias(IApplicationInstance appInstance,
String name, IHTTPStreamerSession httpSession) {
getLogger().info("Resolve Play HTTPSession: " + name);
return name;
}
public String resolvePlayAlias(IApplicationInstance appInstance,
String name, RTPSession rtpSession) {
getLogger().info("Resolve Play RTPSession: " + name);
return name;
}
public String resolvePlayAlias(IApplicationInstance appInstance,
String name, ILiveStreamPacketizer liveStreamPacketizer) {
getLogger().info("Resolve Play LiveStreamPacketizer: " + name);
return name;
}
public String resolveStreamAlias(IApplicationInstance appInstance,
String name, IMediaCaster mediaCaster) {
getLogger().info("Resolve Stream Mediacaster: " + name);
return name;
}
public String resolvePlayAlias(IApplicationInstance appInstance, String name) {
getLogger().info("Resolve Play: " + name);
return name;
}
public String resolveStreamAlias(IApplicationInstance appInstance,
String name) {
getLogger().info("Resolve Stream: " + name);
return name;
}
}
Richard