문제

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