hello.
Im Trying to make the following.
When i click a button a random YouTube Video will show up, how can i make this?
I have no clue, i tryed a random number generator but it didnt go well..
Printable View
hello.
Im Trying to make the following.
When i click a button a random YouTube Video will show up, how can i make this?
I have no clue, i tryed a random number generator but it didnt go well..
You could examine existing youtube urls and try to create some code that would very likely give you a valid youtube video url. Then you'd have to check on youtube to see if such a video exists and if it does great but if it doesn't then you run your random youtube url generator again until it finds one that exists. If you could get a list of all the youtube video urls and put that in a database and search through it that would be nice otherwise your program would have to check via the internet to see if that video exists. I don't know how many youtube videos there are but I would think it's in the tens of thousands if not more.
http://www.youtube.com/watch?v=_0LhWTIos28
You know, you could always have it "random" but go to only this video.
http://www.youtube.com/watch?v=dQw4w9WgXcQ
scrub the page for youtube URLs, using regex, and then use ShockWave Flash (add it to the toolbox or whatever you want) and set the movie url (in the settings of the component) to the youtube vid url. (most of the time you can turn the video url from watch?v=dfi130aZ_3 to /v/dfi130aZ_3&autoplay=1 and it'll play it automatically, /v/ is for the embeding anyway. won't work on videos that have embedding turned off, and vevo uploads.)
if you want i could start the regex for you, but some people don't like free code.