public class WowzaTest extends ModuleBase {
public void onConnect(IClient client, RequestFunction function, AMFDataList params) {
// how do i get stream name in this method or this class
}
}
该玩家是wowza的测试玩家。 Rtmp请求为rtmp://myip:1935/play/myStream
。
答案 0 :(得分:1)
您无法在onConnect中获取流名称,因为RTMP流实际上分为两部分:
rtmp://ip/app[/appinst]
stream
(在您的情况下,您的网址中不存在appinst,因此将自动使用_definst_
)
你可能想要处理播放命令:
http://www.wowza.com/forums/content.php?150-How-to-override-play-to-remap-a-stream-name
或者像这样做:
http://www.wowza.com/forums/content.php?329-How-to-use-IMediaStreamActionNotify3-interface-to-listen-for-RTMP-stream-events-%28includes-codec-info%29