0

i have an rtmp folder with videos, I am trying to do a seamless change to next video using nestsream play2 method. have tried using the fast switching of NetStreamPlayTransitions.SWITCH like below.

        private var FName:Array = ["1av.flv","2av.flv","3av.flv","4av.flv","5av.flv"];
        private var opts:NetStreamPlayOptions = new NetStreamPlayOptions();

// on init of net connection

            video.attachNetStream(stream);
            stream.play(FName[counter]);

// counter increments at playstop of current.
//on playstop of current video. i am calling the new stream function

        public function newStream(address:String):void
        {
            opts.oldStreamName=FName[counter-1];
            opts.streamName = address;
            opts.transition = NetStreamPlayTransitions.SWITCH;
            opts.offset = -1;
            stream.play2(opts);                 
        }

The problem is the switching is not happening. offset=-1 is supposed to be fast switching. The idea is to make a seamless transition to the next video.
if we dont use any transition method or use

opts.transition = NetStreamPlayTransitions.RESET;

its the same as not using any. It just switches normally. RTMP is supposed to provide a relatively faster transition , i am looking for a seamless option .

what am i missing here?

1 Answer 1

0

You're always going to have a second or smaller delay between switching streams due to network lag and processing speed. I would instead instance a second NetStream and begin playing that object while the first stream object stops/fades-out. However, if number of connections is a concern, a hack for this might be to use a sound fx between NetStream switches- masking the delay.

2
  • The switching is to be done on two different video streams.I am unable to see its implementation being faster.If i do instantiate a second nestream and pause it ( it has to start from the first) and then on stop of the first stream handle remove it and replace it with the second stream and then resume it? and try to use a sound effect to mask its transition ? the perceived audio glitch? .
    – Aditya P
    Jan 27, 2012 at 6:04
  • So just to confirm There is no way to make use of play2 method for fast transition of two different content streams.
    – Aditya P
    Jan 27, 2012 at 6:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.