标签存档: NetStream

Flash Player 11应该在两周后发布

2011-09-21:Adobe已经修正了我提交的这个bug,并在安全更新最后做出了感谢。但并非在v11中修正的,而是在v10.3.183.10中修正,安全更新在这里:http://www.adobe.com/support/security/bulletins/apsb11-26.html。所以我先前的推论可能不正确。但我想,Adobe很可能在10月3日的MAX大会上发布Flash Player 11。


今天Adobe给我发来邮件,告知我原来提交的关于FlashPlayer在执行NetStream.play的时候崩溃的问题已经解决,并询问我是否要加入安全公告致谢部分:

Thank you again for sending us the Flash Player Netstream issue. This issue should be resolved in the upcoming release of Adobe Flash, currently planned for the next couple of weeks. Please let us know how you would like to be included in the Acknowledgements section of the upcoming Security Bulletin:

这样,也就说明Flash Player 11应该是在两周后发布。

flashplayer crash on Netstream.play()

Thank smithfox translation,中文版

This is not a 100% frequency bug, I spent 3 days to debug it and I’m not sure I can duplicate it again.

case:

Connect to FMS Server using NetStream, once invoke method NetStream.play(‘streamName’), the flash player will crash.

all of flash player release have the same issue: single,debug,plugin

The bug will appear if satisfy the conditions below, ((but not all)

  1. Win7 OS
  2. Play RTMP stream. RTMP stream can be published by Flash Media Server(FMS) or Red5. In other words, playing local flv/f4v/mp4 video have not this problem
  3. the Stream contains audio
  4. Use Frame meta to pre-load. if you do not understand Frame pre-load, see this article: Preloaders in AS3;
  5. After complete pre-load, call ‘removeChild’ to remove the pre-loaded instance of the class (BUG here).

Development and testing platform (appear BUG)

  1. Flex SDK 4.5.1
  2. Flash Media Server 4.0
  3. Flash Player 10.3
  4. Windows 7
  5. Chrome12/Opera11.5/Firefox5/IE9

继续阅读 »

FlashPlayer在执行NetStream.play的时候崩溃的解决办法

Thank you again for sending us the Flash Player Netstream issue. This issue should be resolved in the upcoming release of Adobe Flash, currently planned for the next couple of weeks. Please let us know how you would like to be included in the Acknowledgements section of the upcoming Security Bulletin:

  • 2011-08-15:Adobe再次回复,并声称解决了此BUG:

这个bug已经在内部修复了,该修复会被包含在flash player 11正式发布版当中。谢谢使用flash player!

  • 2011-08-10:Adobe回复了此BUG:

Hello,
Thanks for your reporting of the issue flashplayer crash on netstream play. We could reproduce the issue and it has been filed in our internal bug system. We are going to >investigate it ASAP. And any update to the it, we will let you know quickly. Thanks!

  • 2011-08-09:向Adobe提交了此BUG

这是个隐藏非常深的BUG,我都怀疑如果再做一次,我能不能把它找出来。它耗费了我宝贵的三天时间,三天啊……

BUG表现

在使用NetStream连接FMS发布的流,并执行NetStream.play(‘streamName’)方法时,FlashPlayer会崩溃。独立版、调试版以及基于浏览器的插件版均如此。

但是,这还不是全部。必须满足以下几点,该BUG才会出现。

  • 使用Windows 7操作系统。也就是说,Windows XP不会出现这个问题;
  • 播放的必须是RTMP流,RTMP流可以由Flash Media Server或者Red5来发布。也就是说,使用NetStream播放本地的flv/f4v/mp4视频不会出现这个问题;
  • 播放的流包含音频。也就是说,如果该流只包含视频,不会出现这个问题;
  • 播放的流中包含的音频声音较大。也就是说,即使该流包含音频,但如果发布方没有发出声音,或者发出的声音很小,该问题不会出现;当然,不需要很大的声音就能让播放端立即崩溃;
  • 使用了Frame标签来做预加载。不了解Frame标签预加载的,看这篇文章:Preloaders in AS3;
  • 在预加载完毕之后,使用removeChild移除了预加载类的实例(BUG就在这里)。

继续阅读 »

NetStream information objects

在NetStream信息对象提供的大量信息中,我常用到的有这么几个:

信息 类型 范围 说明
NetStream.Play.PublishNotify 发布流 所有订阅者 当发布者的流开始发布的时候,所有的订阅者都会收到这个消息。但发布者不会收到这个消息。
NetStream.Play.UnpublishNotify 发布流 所有订阅者 当发布者的流停止发布的时候,所有的订阅者都会收到这个消息。但发布者不会收到这个消息。
NetStream.Publish.BadName 发布流 发布者 当发布者试图发布一个已经存在的流时会收到这个消息。只有发布者可以收到这个消息。
NetStream.Publish.Start 发布流 发布者 当发布者开始发布流的时候收到这个消息。只有发布者可以收到这个消息。
NetStream.Unpublish.Success 发布流 发布者 当发布者结束发布流的时候收到这个消息。只有发布者可以收到这个消息。
NetStream.Play.Reset 播放流 播放者 当播放者开始播放流之前会收到这个消息。只有播放者可以收到这个消息 。
NetStream.Play.Start 播放流 播放者 当播放者开始播放流的时候会收到这个消息。只有播放者可以收到这个消息 。
NetStream.Play.Stop 播放流 播放者 当播放者停止播放流的时候会收到这个消息。只有播放者可以收到这个消息 。

假设我们有2个流,一个叫做PU,用于发布,一个叫做PL,用于播放PU发布的流。那么当PU开始发布的时候(如果发布成功),消息的发布情况是这样的:
PU会收到 NetStream.Publish.Start消息,PL会收到 NetStream.Play.PublishNotify消息。

当PU停止发布的时候,情况是这样的:
PU会收到 NetStream.Unpublish.Success,PL会收到 NetStream.Play.UnpublishNotify。

当PL开始播放的时候,情况是这样的:
PL会收到 NetStream.Play.Reset、 NetStream.Play.Start,PU不会收到任何消息。

当PL停止播放的时候,情况是这样的:
PL会收到 NetStream.Play.Stop消息,PU不会收到任何消息。

由此可见,发布者的发布和停止发布操作,所有的订阅者都可以收到,而订阅者对流的播放操作则并不会通知流的发布者。因此,对于流的控制上,还是要盯紧发布者。 :shock:

检测摄像头和麦克风状态并自动进行处理的类

在对客户的摄像头和麦克风进行探测时,有许多的不确定性。例如,客户可能会禁用摄像头,可能有一个以上的摄像头,还可能先允许使用摄像头,再使用“属性”菜单禁用摄像头。因此,前几天升级聊天室程序的时候,就就写了这样一个类来进行处理,还可以方便在使用了摄像头和麦克风的程序中使用。

其中,Checker类仅用于检测摄像头和麦克风状态并返回;Selecter类继承Checker类,它不仅和Checker一样返回状态,同时也回根据当前的状态做出反映。例如,如果禁用了摄像头,就会显示一个按钮,单击可以打开“设置”对话框。只有当允许使用摄像头时,此按钮才会消失。如果有一个以上的摄像头,则会显示一个下拉列表并提供选择按钮。

用法可以看下面的示例,还提供了一些方法大家可以自行察看as文件。其中,检测麦克风的功能还不完善。

使用示例: 继续阅读 »