caedo Posted July 11, 2008 Share Posted July 11, 2008 Hi, I'm programming a module that works like youtube. You have a player object where the video is played and a list of videos. I'm using AJAX to change the videos dynamically when you click on the image. Right now I'm using Prototype. The problem is that it does'nt changes the video, so I think that the new player is not being loaded. This is the code I have: echo '<object width="625" height="350">'. '<param name="movie" value="'.$_GET['url'].'"></param>'. '<embed src="'.$_GET['url'].'" type="'.$_GET['type'].'" width="425" height="350">'. '</embed>'. '</object>'; I thought that only echoing the HTML tags with the right parameters would make it. Do you have any idea of how to do it? thanks in advance caedo Link to comment https://forums.phpfreaks.com/topic/114304-using-ajax-and-youtube-videos/ Share on other sites More sharing options...
discomatt Posted July 11, 2008 Share Posted July 11, 2008 Why not jsut throw the video in an iframe and use targeted urls to change videos. Saves you from javascript. Link to comment https://forums.phpfreaks.com/topic/114304-using-ajax-and-youtube-videos/#findComment-587769 Share on other sites More sharing options...
adam84 Posted July 11, 2008 Share Posted July 11, 2008 Couldnt you just have ajax return the link of the next video and then use javascript to change the SRC in the embed tag?? Link to comment https://forums.phpfreaks.com/topic/114304-using-ajax-and-youtube-videos/#findComment-587770 Share on other sites More sharing options...
caedo Posted July 11, 2008 Author Share Posted July 11, 2008 Thanks for the post. I'm going to try to implement the approach of adam84 due to time reasons. Link to comment https://forums.phpfreaks.com/topic/114304-using-ajax-and-youtube-videos/#findComment-587776 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.