Jump to content

video loading more then once


beanymanuk

Recommended Posts

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.