A Flash Developer Resource Site

Results 1 to 8 of 8

Thread: How do I assign Unique URL adresses for my video files?

  1. #1
    Senior Member ordack's Avatar
    Join Date
    Jun 2001
    Posts
    107

    How do I assign Unique URL adresses for my video files?

    I have made this video player library.
    I used XML and flash.
    it plays all the videos in a catagorized library that I created but I want to also have a unique address for each flv video in my library so that if I type in that address my video player only plays that individual file.

    any idea how I should go about setting that up?

    Here is the XML code for your review.
    thanks in advance.

    <?xml version="1.0" encoding="utf-8" standalone="yes" ?>
    <root>
    <settings width="900" height="410" spacing="5" playFirstVideo="1" autoPlayNext="1" showAutoPlayButton="1" infoButton="1" />
    <videos>
    <category title="ALL VIDEOS">
    <video title="ScrewPlant_Complete_HiQ" thumb="thumbs/ScrewPlant_Complete_HiQ.jpg" src="videos/ScrewPlant_Complete_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Complete_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Complete_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_DenseBone_HiQ" thumb="thumbs/ScrewPlant_DenseBone_HiQ.jpg" src="videos/ScrewPlant_DenseBone_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_DenseBone_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_DenseBone_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Bone_Cross-Section_HiQ - 2008" thumb="thumbs/ScrewPlant_Bone_Cross-Section_HiQ.jpg" src="videos/ScrewPlant_Bone_Cross-Section_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Complete_HiQ" thumb="thumbs/ScrewPlant_Complete_HiQ.jpg" src="videos/ScrewPlant_Complete_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Complete_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Complete_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_DenseBone_HiQ" thumb="thumbs/ScrewPlant_DenseBone_HiQ.jpg" src="videos/ScrewPlant_DenseBone_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_DenseBone_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_DenseBone_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Bone_Cross-Section_HiQ - 2008" thumb="thumbs/ScrewPlant_Bone_Cross-Section_HiQ.jpg" src="videos/ScrewPlant_Bone_Cross-Section_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Complete_HiQ" thumb="thumbs/ScrewPlant_Complete_HiQ.jpg" src="videos/ScrewPlant_Complete_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Complete_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Complete_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_DenseBone_HiQ" thumb="thumbs/ScrewPlant_DenseBone_HiQ.jpg" src="videos/ScrewPlant_DenseBone_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_DenseBone_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_DenseBone_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Bone_Cross-Section_HiQ - 2008" thumb="thumbs/ScrewPlant_Bone_Cross-Section_HiQ.jpg" src="videos/ScrewPlant_Bone_Cross-Section_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    </category>
    <category title="SURGICAL">
    <video title="ScrewPlant_DenseBone_HiQ" thumb="thumbs/ScrewPlant_DenseBone_HiQ.jpg" src="videos/ScrewPlant_DenseBone_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_DenseBone_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_DenseBone_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Bone_Cross-Section_HiQ - 2008" thumb="thumbs/ScrewPlant_Bone_Cross-Section_HiQ.jpg" src="videos/ScrewPlant_Bone_Cross-Section_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><span class="t2"Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_Complete_HiQ" thumb="thumbs/ScrewPlant_Complete_HiQ.jpg" src="videos/ScrewPlant_Complete_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Complete_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Complete_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    <video title="ScrewPlant_DenseBone_HiQ" thumb="thumbs/ScrewPlant_DenseBone_HiQ.jpg" src="videos/ScrewPlant_DenseBone_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_DenseBone_HiQ</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_DenseBone_HiQ</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </video>
    </category>
    <category title="PROSTHETICS">
    <video title="ScrewPlant_Bone_Cross-Section_HiQ - 2008" thumb="thumbs/ScrewPlant_Bone_Cross-Section_HiQ.jpg" src="videos/ScrewPlant_Bone_Cross-Section_HiQ.flv" >
    <info>
    <![CDATA[<span class="t1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><span class="t2">Information about Implants.</span>]]>
    </info>
    <text>
    <![CDATA[<span class="d1">ScrewPlant_Bone_Cross-Section_HiQ - 2008</span><br /><br /><span class="d2">Information about Implants.</span>]]>
    </text>
    </root>

  2. #2
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    What you'd want to do first is set up your Flash file to accept FlashVars. Essentially that's code in your HTML that passes information into your Flash movie. You'd set up some Flash code that says "if the path to a video has been passed in, play it".

    Once you had that, you could in theory set up separate pages with different values passed in for Flash vars, or just set up one page that you pass variables into on the querystring.

    Such as: http://mysite.com/videoplayer.html?path=myvideo.flv

    So in that case, there's a variable called path with a value of myvideo.flv. Then it's just a matter of getting it from the address bar into your Flash movie, which you can do with Javascript. If you're using SWFObject (which I'd recommend), they have something called getQueryParamValue which gets those variables.

    Check out the documentation for SWFObject here: http://code.google.com/p/swfobject/wiki/api (this has info about FlashVars as well)

    Some info on FlashVars in general: http://www.permadi.com/tutorial/flashVars/index.html

  3. #3
    Senior Member ordack's Avatar
    Join Date
    Jun 2001
    Posts
    107
    Thanks alot rdoyle720 : )
    I will review those links and give it a try.

    I let you know how it goes.

    Thanks again for your help.

  4. #4
    Senior Member ordack's Avatar
    Join Date
    Jun 2001
    Posts
    107
    could you give me an example about the first part, like how do I write the flash vars part in my flash movie?

    should it be on the first frame or it doesn't matter where it is?

    I just don't know how I should write that first section I understand the other steps.


    thank you

  5. #5
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Well it's hard to say exactly without seeing your code and without knowing whether you're using Actionscript 2 or 3, so I'll write some fake code to try to give you the idea.

    Let's say right now my player by default plays file1.flv:

    myVideoPlayer.play("file1.flv");

    And let's say I want it instead to check whether some FlashVars are coming in and if they are, to play that instead. Let's say that FlashVars variable I'm passing in is called myVideoFile. It would be something like:

    if(myVideoFile){
    myVideoPlayer.play(myVideoFile);
    } else {
    myVideoPlayer.play("file1.flv");
    }

  6. #6
    Senior Member ordack's Avatar
    Join Date
    Jun 2001
    Posts
    107
    I'm attaching my XML file just in case.
    I would appreciate it if you could give me an example with my xml refrence.
    I have no action script and just using my XML for controlling the video files.
    Could this be done without adding any codes to my flash file?
    like just adding lines to my XML code?
    Attached Files Attached Files

  7. #7
    Senior Member
    Join Date
    Apr 2002
    Posts
    2,849
    Nope, I can't give you an example with your XML. From your response, it seems that you're using a video player that someone else created? Changing the XML isn't going to help, because you need the information for which file to play to come from outside of the XML.

    If you want unique URLs for each video and the video player only relies on the XML, the only thing you could do is create a separate page with a separate xml file for each page. The other options would be to find another video player that can do what you want, or create your own video player.

  8. #8
    Senior Member ordack's Avatar
    Join Date
    Jun 2001
    Posts
    107
    I already created seperate XML pages for my videos.
    I was just wondering if it was a simpler way to do this but now I get it.
    and yes I have purchased this player from someone else.

    It works for now, but I think eventualy I have to make my own ; )


    thanks again for your help.

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