我有一个连接到 Flash Media Server 的 netConnection。我正在尝试使用 Flash Player 10.1 中的新appendBytes 函数将本地FLV 文件流式传输到FMS。但是我遇到了问题...我在网上获取的文档
function playFile(data:ByteArray):void
{
// data is bytearray data from an already loaded FileReference object
netStream.play(null);
netStream.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
netStream.appendBytes(data);
}
但是,我在appendBytesAction 和appendBytes 方面遇到错误。错误是:错误#2004:参数之一无效....
TypeError: Error #2004: One of the parameters is invalid.
有任何想法吗?
谢谢
你不能使用appendBytes
当您的直播成功时NetConnection
连接到除“null”以外的任何内容。从文档appendBytes
方法在http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29 http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29:
通过一个ByteArray
into a NetStream
用于播放。在 a 上调用此方法NetStream
在“数据生成模式”中。放一个NetStream
进入数据生成模式,调用NetStream.play(null)
on a NetStream
创建于NetConnection
连接到空。呼唤appendBytes()
on a NetStream
不在数据生成模式下的是一个错误并引发异常。
这几乎肯定意味着 Adobe 所谓的“数据生成模式”在连接到 Flash Media Server 实例的连接对象上将不可用。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)