开发者

OSMF/ActionScript 3 - detecting the end of a live RTMP stream, etc

开发者 https://www.devze.com 2023-01-21 06:41 出处:网络
What\'s the best way to check whether there is video data (or not) in a live RTMP stream? For example, if a broadca开发者_JS百科st terminates, can I auto-detect that condition, to perform some sort of

What's the best way to check whether there is video data (or not) in a live RTMP stream? For example, if a broadca开发者_JS百科st terminates, can I auto-detect that condition, to perform some sort of "thank you for watching" behavior?

Also, how can I know if a visitor somehow gets disconnected from the Internet during the broadcast? (So I can notify the visitor of the problem, and give instruction.)

Thanks for any help with this!


conn = new NetConnection();
conn.addEventListener(NetStatusEvent.NET_STATUS, onStatus);

private function onStatus(e:NetStatusEvent):void {
   switch(e.info.code) {
       case "NetStream.Play.StreamNotFound":
       //some code
       break;

       case "NetStream.Play.Stop":
       //some code
       break;
   }
}
0

精彩评论

暂无评论...
验证码 换一张
取 消