www.webdeveloper.com
Results 1 to 3 of 3

Thread: Dynamically Embed YouTube Video (Please Help)

  1. #1
    Join Date
    Aug 2011
    Location
    United States
    Posts
    1

    Angry Dynamically Embed YouTube Video (Please Help)

    What I would like to do seems fairly simple I just can't seem to figure it all out.
    Lets say I am working on myexample.com

    1. What I would like to do is take any random youtube video url let's say youtube.com/watch?v=kffacxfA7G4

    2. Replace "youtube" in the url with "myexample"

    3. Have the video play within myexample.com/watch?v=kffacxfA7G4

    I've seen this exact thing done.
    Just point me in the right direction.
    Thanks

  2. #2
    Join Date
    May 2011
    Posts
    194

    maybe this

    Hi,

    myexample.com/watch? and youtube.com/watch? use same features of services ?

    -----------------------------------------------------------------

    http://www.htmlgoodies.com/tutorials...r-Web-Site.htm

  3. #3
    Join Date
    Dec 2010
    Posts
    59
    So you want the youtube video to play on your site, using the YT video IDs?

    If so (written quickly so there may be mistakes, security concerns & using YT's embed code):
    PHP Code:
    // UNTESTED
    <?php
    // Get the Video ID
    $_GET['v'] = $vid;

    echo 
    "<iframe width='425' height='349' src='http://www.youtube.com/embed/" $vid "' frameborder='0' allowfullscreen></iframe>";
    ?>

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles