Skip to main content
Leafcutter
Inspiring
May 13, 2014
Question

Switching between videos mid play

  • May 13, 2014
  • 1 reply
  • 351 views

I am using StageVideo to play a video file on iOS (ipad mostly) and it runs ok.  I recently shot some video from 3 different camera angles and so I thought I would try to give the user the flexibility to play the video and switch between camera angles on the fly. 

Is there a 'best' way to do this or has anyone achieved something similar?  I've experimented with just switching the net stream mid flow to play a new file (but this starts again from the beginning).  Ideally I want the transition between streams to be seamless so that dialogue / music etc is not affected.

Is it possible to have the three net streams all running in the background and then attach the desired one into the stage video container on a button press?  I'm targetting iOS 7 devices but I don't know if performance will be an issue.  Or maybe have 3 stage video instances and try to hide/shuffle them at runtime (although I think iOS only has 1 stagevideo instance at a time?)

This topic has been closed for replies.

1 reply

May 13, 2014

I don't see why you couldn't have 3 NetStreams going on at the same time and switch between them on the fly. You may encounter memory issues though depending on the length, quality, resolution, and overall file size of the videos. And Im not positive on this but I think that NetStream audio will come through regardless of it being attached to a video object, so be sure to mute the 2 that are on standby.

Leafcutter
Inspiring
May 13, 2014

I tried 3 net streams and it starts causing the app to slow down so I think there might be a performance issue. And there is also the audio issue where it keeps playing the audio track even when you switch to another stream which suggests that possibly some resources are held on to when you change stream - this makes me a bit nervous as there may be things going on in the background of stage video or assumptions that have been made that aren't obvious at the actionscript level.


I am working with one net stream now and then just changing the source file mid flow - with a seek immediately afterwards this gives almost uninterrupted video which is almost good enough.  Ideally I'd like it to operate like a live mixer but based on my previous experiences with StageVideo (where I spent a lot of time getting to a solution that worked) I might quit while I am relatively not as far behind as I was.

May 13, 2014

Sorry to hear that. You might be able to add some kind of cover up or animation UI while the switch is being made so it seems like the short delay is on purpose.