如何在 LIVE NetStream 上捕获 StreamNotFound?
我有一个 FLEX 应用程序,当我执行 NetStream.play(); 时,我需要知道 FMS 上的实时流是否存在。 示例:
var stream = new NetStream(nc);
stream.play("streamnotexists");
我如何选择播放时的错误如何尝试播放不存在的流?
I have an FLEX application where I need to know if the LIVE stream on FMS exists when I do a NetStream.play();
Example:
var stream = new NetStream(nc);
stream.play("streamnotexists");
How can I pick the error on play how are trying to play a tream that not exists ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要在网络流上编写一个监听器函数,用于状态类型事件。作为一种状态,您将获得 NetStream.Play.StreamNotFound 。
请参阅此和此以进一步了解。
You need to write a listener function on your netstream, for status type event. As a status you get NetStream.Play.StreamNotFound .
Refer to this and this for further understanding.
您应该向 NetStream 对象添加一个侦听器,如下所示:
其中
netStatusHandler
是:event.info.code 的完整列表可以在此处找到:http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetStatusEvent.html 但请注意,只有以
开头的事件NetStream.
由NetStream 对象触发。You should add a listener to your NetStream object, like so:
where
netStatusHandler
is:The complete list of event.info.code can be found here: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/events/NetStatusEvent.html but be aware that only the events that begin in
NetStream.
are triggered by the NetStream object.