Copy link to clipboard
Copied
This code do not work:
data - ByteArray
var nc:NetConnection;
var ns:NetStream;
ns.appendBytes(data);
nc=new NetConnection();
nc.connect(null);
ns=new NetStream(nc);
var video:Video = new Video();
video.attachNetStream(ns);
ns.play(null);
addChild(video);
Help me!
Copy link to clipboard
Copied
where's data defined?
Copy link to clipboard
Copied
I download video mp4 or 3gp file from local memory.
Copy link to clipboard
Copied
that's where your error is. show the code that defines data.
Copy link to clipboard
Copied
I try to load video from local computer.
I alreary done it for FLV format via NetStream.
Now i need to support MP4 and 3GP video formats. I don't know can I do it only in client or I need first upload video to server and than than use it.
Copy link to clipboard
Copied
i don't understand your lasst question.
in addition, it's not clear why your using appendBytes. the only thing that's clear is that the error is in defining data and you're not showing what that error is.
Copy link to clipboard
Copied
1. appendBytes understands FLV only by default.
2. In order to play mp4 (or any other than FLV format) you need to use appendBytesAction(NetStreamAppendBytesAction.RESET_BEGIN) so that Flash reads file correctly. This is quite a flaky proposition anyway.
3. appendBytes must be called after play(null) is called. Otherwise Flash throw an error.
Correct sequence:
ns.play(null);
ns.appendBytes(ba);
Incorrect sequence:
ns.appendBytes(ba);
ns.play(null);
Find more inspiration, events, and resources on the new Adobe Community
Explore Now