有没有可以播放视频byteArray流的灵活视频播放器?我想在视频播放器中播放视频文件byteArray。
任何网站链接或商业组件链接或文章都将受到赞赏。
答案 0 :(得分:0)
检查一下,这可能会对你有所帮助
private function playBytes(bytes:ByteArray):void
{
// detecting it's header
if (bytes.readUTFBytes(3) != "FLV")
{
_text.appendText("\nFile \""+ file +"\" is not a FLV")
return void;
}
bytes.position = 0;
netConnection.connect(null);
netStream = new NetStream(netConnection);
netStream.client = { onMetaData:function(obj:Object):void { } }
video.attachNetStream(netStream);
addChild(video);
// put the NetStream class into Data Generation mode
netStream.play(null);
// before appending new bytes, reset the position to the beginning
netStream.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
// append the FLV video bytes
netStream.appendBytes(bytes);
}
此属性/方法在3.0或3.5 sdk
中不可用netStream.appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN);
netStream.appendBytes(bytes);
你可以使用4.1 sdk及以上的playerglobal.swc,它会工作......