Search code examples
actionscript-3flashvideomultiple-instancesnetstream

Multiple videos attached to a NetStream


After pulling my hair for some time and searching the internet, I came to the conclusion that Flash doesn't allow you to attach more than one Video to a NetStream object. That's a same since, I suspect, that would lower much resources consumption especially in cases like mine where I want to play the same video at 5 different places across the screen.

If there has been no real solution to the above after all these years, then may I ask for an opinion of what would be optimal. Either:

a) Create 5 different NetStreams pointing to the same video file, and respective Videos attached to them.

or:

b) Have 1 NetStream and 1 Video, then for every frame convert the Video to a BitmapData (through .draw function), then assign this BitmapData to 5 different Bitmaps.

Edit : in case of option (b), does anyone know how to track each frame change? Or will it have to be done through Event.ENTER_FRAME (totally unoptimized solution)?


Solution

  • If your intension is to have the videos synchronized, you'll want to use option 'b'. This will also be better for performance. Just as a note for BitmapData though; if you're using a service like YouTube, you may not be able to use draw unless you run it through a proxy first.