beanymanuk Posted May 12, 2010 Share Posted May 12, 2010 I have a problem where a html 5 video is being recreated many times and I can hear copies playing behind the one I can see on the screen. I have tried return false; in the onclick but this does not fix it <form name="videourl" action="javascript:changeVideoUrl(document.videourl);" method=""> <input name="url" type="hidden" value="http://www.peter-gosling.com/tagit/vids/ogv/test.ogv" size="40"/> <input name="button" type="button" value="Click For Question 1" onclick="changeVideoUrl(this.form); return false;"/> </form> <script type="text/javascript"> // get video element var video = document.getElementsByTagName("video")[0]; // change the video's url function changeVideoUrl(form) { var newurl = form.url.value; video.src = newurl; // possibly the change of a hash on a video's src attribute could be done // without having to re-load the file video.load(); } </script> There is also more Javascript on the page which is to do with drag and drop this could also be conflicting with it Full file attached Thankyou in advance [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/201567-video-loading-more-then-once/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.