A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Dynamically using the MediaPlayback component?

  1. #1
    Member
    Join Date
    Jan 2004
    Posts
    43

    Dynamically using the MediaPlayback component?

    I have a nice site set up to play some FLV files using the Media Playback component, and everything works great.

    However, whenever I need to change the movies, perhaps once a month, I need to edit my FLA, go in, change the paramenters in the component inspector to reflect my new URL and adjust the video length, etc.

    Is there a way to set these properties in actionscript? So that I don't need to edit my FLA and re-publish it each time? I was thinking that these paramenters can all be set in an XML file to be read by the SWF file so that I can swap movies just by editing the XML file.

    Any suggestions are greatly appreciated! I can't imagine I'm the first one to need to do this. Thanks!!

  2. #2
    Media Services
    Join Date
    Jul 2004
    Posts
    252
    No, you not the first one

    This is not really complicated. You could load your video FLV info usinf FlashVars. That way you could have external file (XML) with all clip info and pass it to SWF via FlashVars.

    You can find sample of something like that on FLVplayer.com in samples section.
    It's PHP based video list based on script from Videospark.

  3. #3
    Member
    Join Date
    Jan 2004
    Posts
    43
    Thanks so much, that's basically what I was looking for. But is the sample code available on flvplayer.com for me to look at? I can view the sample, but I'd like to get a look at the FLA and the PHP code.

    Thanks again.

  4. #4
    Media Services
    Join Date
    Jul 2004
    Posts
    252
    this will work basically with any componet or custom build player. There is no FLA to download since this is 3rd party FLV Player component, but you can download free PHP script from Videospark.com and use or replace their player with player of your choice (including MM components). They did really great job with their PHP/ASP list.

  5. #5
    Member
    Join Date
    Jan 2004
    Posts
    43
    Hmm, well unfortunately where I'm trying to put these FLV's, I can't use PHP or ASP scripting, so I'm trying to get the list of videos populated via XML. Now, I can get the XML list populated into a SWF, I'm just a little fuzzy on how to tell the player which FLV from my XML list to play.

    So I'm back to square one I guess? Trying to use FlashVars to load the video parameters? I just don't understand how to do this using the Media component that comes with FlashMX. Currently I have to go into the component editor and manually change the URL and duration of the clip each time.

    Do I need to use a different media player? One that can be passed the parameters?

    Thanks so much!

  6. #6
    Media Services
    Join Date
    Jul 2004
    Posts
    252
    Why do it manually when you can use media classes: setMedia();

    http://www.flvplayer.com/forum/viewtopic.php?t=22

    Clip duration is retrieved from MetaData info.

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