Page 1 of 3 123 LastLast
Results 1 to 10 of 21

Thread: loading a youtube video into div using dynamic ajax content

  1. #1
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default loading a youtube video into div using dynamic ajax content

    1) Script Title: dynamic ajax content

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem:
    ok first off, is this possible? I would like to load or embed a youtube video into a div tag using links within the page, each link would load a different video in the same space.

    I already have the dynamic ajax content script working on my homepage to load updates into a separate box from links on the side, unfortunately I don't have a link to show you what I mean.

    I have very little experience in web design, and it's a miracle I gotten this far with my site, so if this is the wrong way to go about doing this please let me know.
    thanks
    Last edited by cookie44; 06-04-2009 at 07:25 PM. Reason: resolved

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    If you already know how to load files in the box, then the only thing you have to do is this: in a file you want to show in the box, put something like
    <iframe src="http://www.youtube.com/v/fnknjPXCM8I&hl=nl&fs=1&" style="position:absolute;width:550px;height:100%"></iframe>.
    ===
    Arie Molendijk.

  3. #3
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I'm afraid that didn't work, I need some way of actually embedding the video player into the page from youtube, not a saved file in my directory. Here's the code youtube suggests using:

    <object width="480" height="385"><param name="movie" value="http://www.youtube.com/v/Y8wxB_PnoyQ&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Y8wxB_PnoyQ&hl=en&fs=1&rel=0&color1=0x3a3a3a&color2=0x999999" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object>

    now that works, but it simply puts the video and player in the box, whereas I only want it to do that once the link to the right is clicked on

  4. #4
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    That's odd. It works on my side! It's not a saved file.
    ===
    Arie.

  5. #5
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    could you post me a link to your site so i can have a look at your source? thanks

  6. #6
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

  7. #7
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    thats wicked mate thanks a lot, now I shall dissect it and figure out where I went wrong

  8. #8
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    ok could you tell me what you have inside your 'ajaxfiles/external.htm' file to get the just the video to load?

  9. #9
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,881
    Thanks
    49
    Thanked 266 Times in 258 Posts
    Blog Entries
    56

    Default

    The file has this:
    <iframe src="http://www.youtube.com/v/fnknjPXCM8I&hl=nl&fs=1&" style="position:absolute;width:550px;height:400px"></iframe>

    Putting the right url in the iframe does the trick. From the embedding info given by YouTube, you just have to take the value of the first param. That's all.

    ===
    Arie.

  10. #10
    Join Date
    Jun 2009
    Posts
    8
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    <iframe src="http://www.youtube.com/v/Y8wxB_PnoyQ&hl=en&fs=1&" style="position:absolute;width:480px;height:385px"></iframe>

    sorry mate, i put the above into my file to be loaded, but it just loads the text above, not the actual video

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
  •