Search code examples
actionscript-3flashvideortmpamazon-cloudfront

Flash (Actionscript 3): Play 2 videos from 1 NetStream?


I'm streaming a video from an Amazon CloudFront RTMP source with

video.attachNetStream(myNetStream);
myNetStream.play(myVideoFileName,0,-1);

and it's working quite well. Now, what I want to do is something like this:

video1.attachNetStream(myNetStream);
video2.attachNetStream(myNetStream);
myNetStream.play(myVideoFileName,0,-1);

This doesn't work as written because only one of the two videos will play at a time for some unknown reason. I want video1 and video2 to play the same video from a single NetStream (to save bandwidth) and remain completely in-sync with each other. How can I accomplish this?


Solution

  • bitmapData can't be accessed at all because of security restrictions. I'm going with plan B which is playing 2 netstreams, but reducing the file size of the one the videos by removing its audio. I'll have to wait until Amazon allow security policy access to use the bitmapData solution.