|
-
May 13th, 2011, 10:38 AM
#1
Thread Starter
Junior Member
Need some help please.
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..
-
May 13th, 2011, 06:11 PM
#2
Fanatic Member
Re: Need some help please.
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
Last edited by EntityX; May 13th, 2011 at 06:18 PM.
 Make as many mistakes as you can as quickly as you can. We want to make sure that we make a great enough number of mistakes in a given amount of time so that we can be successful.
"Persistence is the magic of success." Paramahansa Yogananda
-
May 14th, 2011, 04:29 AM
#3
Addicted Member
Re: Need some help please.
You know, you could always have it "random" but go to only this video.
http://www.youtube.com/watch?v=dQw4w9WgXcQ
-
May 14th, 2011, 04:25 PM
#4
Lively Member
Re: Need some help please.
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|