SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Angry Dynamically Embed Any YouTube Video

    I've seen this exact thing done. I just can't seem to figure it all out.


    Lets say I am working on website.com

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

    2. Have the user replace "youtube.com" in the url with "website.com"

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

    Thanks

  2. #2
    SitePoint Member
    Join Date
    Jul 2011
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    do u want to redirect?

  3. #3
    SitePoint Member
    Join Date
    Aug 2011
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I want the video to play in an an embedded player within myexample.com, but pull the video to be played from the url.

    example: myexample.com/watch=VIDEOID

  4. #4
    SitePoint Enthusiast
    Join Date
    Aug 2010
    Location
    Perundurai, Tamilnadu, India
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Take any embed code from youtube, just make the video id to appear dynamic based on your VIDEOID parameter.

    <iframe width="425" height="349" src="http://www.youtube.com/embed/<?php echo strip_tags($_REQUEST['VIDEOID']); ?>" frameborder="0" allowfullscreen></iframe>
    website.com/watch.php?VIDEOID=kffacxfA7G4

    With old embed code, there are some author restrictions not to play outside youtube. But now with this iframe embed code, most of the videos are working well.


Tags for this Thread

Bookmarks

Posting Permissions

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