Results 1 to 6 of 6

Thread: Getting the url in flash and integrating it with the video player?

  1. #1
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default Getting the url in flash and integrating it with the video player?

    I am trying to make a video player that will save space on my website. Since my site will have videos uploaded from users which then the videos automatically get put on my site.
    I have the flv component player on the stage and i gave it an instance name of "player". I am totally helpless when it comes to action script.
    What I want to do is to have flash grab the url and in the URL like below:
    Code:
    http://localhost/new/video.php?watch=id
    The highlighted part is what i want the video player to grab the id and search through a directory probably going to be videos/ to grab the content.

    Thanks in advance,

  2. #2
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Hey Rockon...

    Have you tried asking Flash nicely? That usually works for me

    What you're looking for here is flashVars. FlashVars are, as the name implies, variables that you set outside of a .swf file. So, you can easily pass dynamic variables to flash at runtime. Flashvars go directly into the embed code on your HTML page.

    So, you would add something similar to this to your page:
    Code:
    <PARAM NAME=FlashVars VALUE="id=80">
    Since you're using PHP, you can easily parse the URL and echo the id number into the code.

    With some quick googling, I found this: http://www.permadi.com/tutorial/flashVars/
    There are probably better tutorials out there, but I don't have the energy to look right now. I'm sure you can easily find better ones if that one doesn't explain everything.

    Also, on a design note...
    I find the Flash components to be hideous. So, if you're interested in building your own flash video player, I'd suggest that you check out the tutorials at www.gotoandlearn.com by Lee Brimelow. The video tuts are towards the bottom of the page. He walks you through the process, step by step so anyone can make one and you can alter it to fit with the design of your page.

    Hope that helps. Post back if you have more questions.

  3. The Following User Says Thank You to Medyman For This Useful Post:

    Rockonmetal (04-23-2008)

  4. #3
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    Another question i have that sorta applies to this topic... Is there a way to convert videos users upload to flv format automatically as they upload them?
    Thanks

  5. #4
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    Quote Originally Posted by Rockonmetal View Post
    Another question i have that sorta applies to this topic... Is there a way to convert videos users upload to flv format automatically as they upload them?
    Thanks
    Yes, but they're all expensive solutions. You want to look into the Flash Media Server.

    We (i.e. my web design/development company) use it sporadically for some of our bigger clients. If it this is within your means and you want some more info, I can provide it if you want.

  6. The Following User Says Thank You to Medyman For This Useful Post:

    Rockonmetal (04-23-2008)

  7. #5
    Join Date
    Jan 2007
    Location
    The stage
    Posts
    568
    Thanks
    23
    Thanked 6 Times in 6 Posts

    Default

    K thanks... I'll check it out... I am having some problems with the video player... The code in the action script for the player is:
    Code:
    import mx.video.player;
    player.contentPath = ID;
    The parameter line is:
    Code:
    <PARAM NAME=ID VALUE='videos/" . $row['id'] . ".flv'>
    The row['id'] thing is correct... I think I just haven't linked the video properly in flash
    If someone could help that would be great...
    Last edited by Rockonmetal; 04-23-2008 at 08:51 PM.

  8. #6
    Join Date
    Mar 2007
    Location
    Currently: New York/Philadelphia
    Posts
    2,735
    Thanks
    3
    Thanked 519 Times in 507 Posts

    Default

    The param name always has to be Flashvars

    Code:
    <PARAM NAME=FlashVars VALUE="ID=videos/2.flv">

Bookmarks

Posting Permissions

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