Skip to main content
May 23, 2011
Question

FLV Playback component - stop previous videoplay at new video event

  • May 23, 2011
  • 1 reply
  • 347 views

There seems to be tutorials on starting the next video at completion of the previous one using the FLV2.5 Playback component, but I am looking for some help with stopping a video playback event when a new one is triggered.  Ex.  Video one button is clicked and video starts playing, viewer clicks video two button mid way through playback of video one and starts video two.  How do I stop the playback of video one when video two button is clicked to avoid both playing simultaneously?

I have used:

if (snd ! = null) {

     channel.stop();

}

for audio files sucessfully.  Can you suggest a similar apporach?

Many thanks

mememellowcore11

This topic has been closed for replies.

1 reply

Kenneth Kawamoto
Community Expert
Community Expert
May 23, 2011

If you set source property to a new video the previous one should just stop.

If not you can try stop() before setting a new source. Failing that, you can dig deeper: FLVPlayback.getVideoPlayer() > VideoPlayer (you can call stop()) > VideoPlayer.netStream > NetStream (you can call close())