質問

I want to ask how to save video and audio content that I'm loading from some site through a NetStream as an FLV file.

Is there any possible way to do this?

var ns:NetStream = new NetStream(nc); 
ns.play('http://somefile.com/file.flv');
var file:FileReference=new FileReference();
**ns.doSomething(file); /// ???**
file.save(data,"flvfile.flv");  
役に立ちましたか?

解決

I don't think you can do this with NetStream - it doesn't necessarily hold the entire file at any one time.

Why not just point the file reference to 'http://somefile.com/file.flv' - open that, then grab the data from it and save that with another reference once it has completed downloading? You can either run the NS in parallel as a separate operation, or open the NS from the local disc once it has finished downloading.

There's a good answer regarding downloading directly using a FileReference, and the gotchas it involves, here: Flex 3 file download - Without URLRequest

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top