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.
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.
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.
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:
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?
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.
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 ; )