-
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
-
-
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.
-
-
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
-
-
That's odd. It works on my side! It's not a saved file.
===
Arie.
-
-
could you post me a link to your site so i can have a look at your source? thanks
-
-
I made a quick one for you here.
===
Arie.
-
-
thats wicked mate thanks a lot, now I shall dissect it and figure out where I went wrong
-
-
ok could you tell me what you have inside your 'ajaxfiles/external.htm' file to get the just the video to load?
-
-
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.
-
-
<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
-
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
Bookmarks