Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 5 123 ... LastLast
Results 1 to 15 of 64
  1. #1
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts

    Play multiple FLVs through a single swf player in squence

    I have a swf player which has multiple buttons to play other flvs.

    The flvs start automatically, but stop after playing once. I want them to play one after the another one and on a timeless loop. There are four flvs and skin FLVcomponent link is myVideo.

  • #2
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    http://www.*******************/?item=JW_FLV_Player

    I would use this player, which has build in support for a playlist and all of the features you are talking about.

  • #3
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    actually my flash player has a very customized design that I can't really change. So I will need to incorporate that functionality within the player.

  • #4
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Alright well there is a great tutorial about flash playlists on www.gotoandlearn.com, if you are interested in tackling that yourself. Otherwise I'm going to need to see some code or the FLA.

    I woudln't know how hard it is to incorporate, but the tutorial would be a great place to start.

  • #5
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    I will start with that. And if I run into problems I will ask you here.

    thanks

  • #6
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    i watched how to make a playlist through xml and then import it in flash. Actually I am looking for something very simple. Which is to basically play three-predefined videos one by one in the swf file. So I am willing to make changes to the *.fla file rather than dynamically updating videos through xml.

    Any help in this regard will be helpful.

    This is the code that I have used so far

    myVideo is the instance name of the FLVPlayback component
    Code:
    myVideo.playPauseButton = play_paus_btn;
    myVideo.muteButton = mute_btn;
    
    promo_btn_01.onRelease = function():Void
       {
          myVideo.play("flv_video1.flv");
       }
    
    promo_btn_02.onRelease = function():Void
       {
          myVideo.play("flv_video2.flv");
       }
    
    promo_btn_03.onRelease = function():Void
       {
          myVideo.play("flv_video3.flv");
       }

    That is all. What I want to do is to play the flv_video1.flv, flv_video2.flv and flv_video3.flv in a sequence with a continuous loop, while the user also has the power to start any of the video by pressing the respective button as described in promo_btn_**. (the button functionality has already been incorporated)

  • #7
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Ok you need to do two things for the automatic looping.

    1) Put your videos into an array

    Code:
    var videoList:Array = new Array();
    videoList[0] = "video1.flv";
    videoList[1] = "video2.flv";
    videoList[2] = "video3.flv";
    videoList[3] = "video4.flv";
    var currentlyPlaying:Number = 0;
    2) Setup a listener for the end of the currently playing video, and when complete have it start the next video in the array

    Code:
    import mx.video.*;
    var listenerObject:Object = new Object();
    listenerObject.complete = function(eventObject:Object):Void {
        currentlyPlaying++;
        if (videoList.length > currentlyPlaying) {  // Resets counter if reaches end of array
            currentlyPlaying = 0;
        }
        myVideo.play(videoList[currentlyPlaying]);
    };
    myVideo.addEventListener("complete", listenerObject);
    I'm not 100% on the code, because I just wrote it without testing it. But look up the things in the documentation if you need clarification what it is.

  • Users who have thanked gnomeontherun for this post:

    ksduded (05-05-2008)

  • #8
    New to the CF scene
    Join Date
    May 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Event Listener

    Hey friends, sorry if this is a dumb question, new guy here...

    for the code above, how do you register the event listener to trigger when the video is done playing?

    Also, perhaps we are not on the same page here but I am using AS 3.0 with my FLEX builder and cant find the mx.video package for some reason

    I have the movie player up and running and I just want it to play a couple clips in a row

    any help would be appreciated
    Last edited by cain; 05-02-2008 at 05:43 AM.

  • #9
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Cain,

    All of this code is for AS2, and AS3 is a whole different setup. I honestly don't know much about AS3, but www.gotoandlearn.com has some tutorials about video playlists.

  • #10
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    i have put the first code in the global script to define the array.

    but I am not sure how to setup the listener for the end of the movie.
    can you please explain where I should be putting the second code.

    thanks

  • #11
    New to the CF scene
    Join Date
    May 2008
    Posts
    6
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I figured that must be why I couldn't find it... anyone know why this won't work? I want a video to launch and then during the first 5 (or 10, 20, etc.) seconds show one popup (if clicked) and during the rest of the show launch a seperate popup... its not working right though, it seems that it launches the first dialog box regardless

    also ideal would be to just pass in a number or string so the dialog box could delegate internally what to display

    I am working with the FLEX builder and AS3.0

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" verticalAlign="middle"
    width="418" height="385">

    <mx:Script>

    <![CDATA[

    <!-- Handles creating the pop up manager for the what was that window -->
    import mx.managers.PopUpManager;

    private function launchMoreInfo():void {


    if (videoPlayer.playheadTime>5){
    var winialog = PopUpManager.createPopUp(this, Dialog, true) as Dialog;
    }
    else{
    var win2ialog2 = PopUpManager.createPopUp(this, Dialog2, true) as Dialog2;
    }
    PopUpManager.centerPopUp(win);
    }

    ]]>

    </mx:Script>

    <mx:VBox backgroundColor="white" width="416" height="383">
    <mx:VideoDisplay width="415" height="349" id="videoPlayer"
    source="./test.flv" />
    <mx:HBox width="412" horizontalAlign="center">
    <mx:Button label="Play" click="videoPlayer.play()" id="playButton"/>
    <mx:Button label="What was that?" click="launchMoreInfo();videoPlayer.pause();"/>
    </mx:HBox>
    </mx:VBox>
    </mx:Application>

  • #12
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    @Cain you should start a new thread, since this is not the same issue.

    The second part of the code should go just on the root timeline on the first frame (probably what you call the global script?)

  • #13
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jeremywilken View Post
    @Cain you should start a new thread, since this is not the same issue.

    The second part of the code should go just on the root timeline on the first frame (probably what you call the global script?)
    I am not sure what I am doing wrong. But I pasted the code in the first frame of a layer called action. That is also where I have defined the other code that you mentioned. But it comes after the second code.

    After publishing it. It plays the video which has been linked in the flvplayback component, and then it plays the last video in the array, i.e. flv_video3.flv. After playing that it stops.

    What am I doing wrong?

  • #14
    Senior Coder gnomeontherun's Avatar
    Join Date
    Sep 2007
    Location
    Houston
    Posts
    2,846
    Thanks
    10
    Thanked 238 Times in 229 Posts
    Ok, its probably the code I wrote. At least it plays a second one, like I said I didn't test that code since I don't have your fla. Could you post that file?

  • #15
    New Coder
    Join Date
    Apr 2008
    Posts
    95
    Thanks
    20
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by jeremywilken View Post
    Ok, its probably the code I wrote. At least it plays a second one, like I said I didn't test that code since I don't have your fla. Could you post that file?
    This is the file that I have been working on
    http://sbproductions.startlogic.com/...sh_skin_04.rar

    btw, thanks for all the help. Really appreciate it.


  •  
    Page 1 of 5 123 ... LastLast

    Posting Permissions

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