A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Multiple simultaneous FLV Playback controlled by the same play button?

  1. #1
    Junior Member
    Join Date
    Oct 2007
    Posts
    1

    Multiple simultaneous FLV Playback controlled by the same play button?

    Hello,

    First post, did a search through the forums to see if anyone has run into this, no luck though. It may be a lot easier than I think, but I'm having trouble wrapping my head around it:

    Basically I just want to have two identical flvPlayback components controlled by the same button(s). Ex. The user presses the play button and two (or more) videos start playing simultaneously. Then, when the pause button is pressed, they both stop.

    Cheers to anyone who can help!

  2. #2
    Junior Member
    Join Date
    Mar 2008
    Posts
    2
    Has anyone else thought about this?

    I, too, am looking for a solution to the same problem. The only thing I've thought of, but haven't tried so far is controlling the second video based on what ever the first one is doing. i.e. if the first video is paused, pause the second...

  3. #3
    Junior Member
    Join Date
    Dec 2001
    Posts
    2
    I'm also looking for the solution to this problem

  4. #4
    Junior Member
    Join Date
    Mar 2008
    Posts
    2
    Here's the solution I came up with. It's not always exact (may be off by a frame or so), but it's as good as I could get.

    Say we have 2 FLVplayback components on the stage named "flv1" and "flv2." The idea is to use a couple of event handlers to know when "flv1" is playing or paused. This is the code I used, but it can be written with listener objects instead of functions if you like:

    Code:
    // Event Handlers and Functions for controlling 2nd vid player
    function isPaused(eventObject:Object):Void {
           flv2.pause();
    };
    function isPlaying(eventObject:Object):Void {
           flv2.play();
    };
    
    flv1.addEventListener("playing", isPlaying);
    flv1.addEventListener("paused", isPaused);
    Be careful of putting any other code in the event handler functions as it slows flash down and the video can be less responsive. Also, I've noticed that the video usually only gets off by a bit after I've paused it and started playing again.

    -ian

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center