NetStream.appendBytesNetStream、appendBytes

2023-09-08 11:31:36 作者:抚琴之人泪满衫

我有连接到Flash Media Server的一个NetConnection。我试图使用新的对appendBytes功能与Flash Player 10.1流本地FLV文件到FMS。我有问题,但是......我的文档上网

I have a netConnection connected to a Flash Media Server. I am trying to use the new appendBytes function from Flash Player 10.1 to stream a local FLV file to FMS. I'm having issues however... Documentation I get online

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:其中一个参数是无效的......

However, I'm getting an error with the appendBytesAction and appendBytes. The error is: Error #2004: One of the parameters is invalid....

TypeError: Error #2004: One of the parameters is invalid.

任何想法? 谢谢

Any ideas? Thanks

推荐答案

您无法使用对appendBytes 成功时,你流的NetConnection 连接到任何东西比空。从对appendBytes 法的http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29:

You can't use appendBytes successfully when your streams NetConnection is connected to anything else than "null". From the documentation of appendBytes method at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#appendBytes%28%29:

将一个ByteArray传递到NetStream以进行播放。在数据生成模式的NetStream调用此方法。要使NetStream到数据生成模式,调用NetStream.play(空)上的NetStream上的的NetConnection连接到null创建。在调用在NetStream,是不是在数据生成模式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实例。

This almost certainly implies that the what Adobe calls Data Generation Mode will not be available on a connection object connected to say, a Flash Media Server instance.

相关推荐