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)
- Win7 OS
- 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
- the Stream contains audio
- Use Frame meta to pre-load. if you do not understand Frame pre-load, see this article: Preloaders in AS3;
- After complete pre-load, call 'removeChild' to remove the pre-loaded instance of the class (BUG here).
Development and testing platform (appear BUG)
- Flex SDK 4.5.1
- Flash Media Server 4.0
- Flash Player 10.3
- Windows 7
- Chrome12/Opera11.5/Firefox5/IE9
BUG reproduction
I've wrote two simple Demo (one is sender,and another is receiver) to reproduce this bug. (Demo needs FMS support.)
The key is PreloaderNSPlay.as. As the pre-loaded class is no longer needed after the completion of loading, the general way is removing it from Stage. Bug will occur after removal (not occur immediately, but in a time of receiving the audio stream). If using 'visible' to hide pre-loaded classes, would not have this problem.
Usage of the Demo (Here, the server is FMS)
- Install FMS, create folder
/applications/testspeed/
under the installation directory0 文件 - Make sure that cameras and microphones are installed on your PC. run NSPublish.swf, click "connect" button, then view log to confirm the connection is OK,see the following figure.
- If client has been connected the FMS server successfully, we will can watch the cameras video, if the flash player still does not crash, let's breath toward the microphone, ...huuuuu...., the whole wold are quiet!!
The full source code of the project is here
NSPublish.as is the video publisher, NSPlay.as is the receiver. You can build the project using Ant, and you can change the SDK in build.properties file.
- 文章ID:1400
- 原文作者:zrong
- 原文链接:https://blog.zengrong.net/post/flashplayer-crash-on-netstream-play/
- 版权声明:本作品采用 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 进行许可,非商业转载请注明出处(原文作者,原文链接),商业转载请联系作者获得授权。