Results 1 to 4 of 4

Thread: Need some help please.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2011
    Posts
    30

    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..

  2. #2
    Fanatic Member EntityX's Avatar
    Join Date
    Feb 2007
    Location
    Omnipresence
    Posts
    798

    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

  3. #3
    Addicted Member
    Join Date
    Apr 2011
    Posts
    223

    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

  4. #4
    Lively Member
    Join Date
    Aug 2010
    Location
    Look to the right... yep, there i am.
    Posts
    111

    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
  •  



Click Here to Expand Forum to Full Width