加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

flash – NetStream.appendBytes

发布时间:2020-12-15 07:23:34 所属栏目:百科 来源:网络整理
导读:我有一个连接到Flash Media Server的netConnection.我试图使用Flash Player 10.1中新的appendBytes函数将本地FLV文件流式传输到FMS.我遇到了问题……文档我上网了 function playFile(data:ByteArray):void{// data is bytearray data from an already loaded
我有一个连接到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.

有任何想法吗?
谢谢

解决方法

当您的流的NetConnection连接到“null”以外的任何其他内容时,您无法成功使用appendBytes.从 http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29的appendBytes方法文档:

Passes a ByteArray into a NetStream for playout. Call this method on a NetStream in “Data Generation Mode”. To put a NetStream into Data Generation Mode,call NetStream.play(null) on a NetStream created on a NetConnection connected to null. Calling appendBytes() on a NetStream that isn’t in Data Generation Mode is an error and raises an exception.

这几乎肯定意味着Adobe称为“数据生成模式”的内容将无法在连接到Flash Media Server实例的连接对象上使用.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读