1

I'm having the same issue as described in this post:

HTML5 video will not loop

So basically my videos won't loop (and cannot be seeked ) in chrome. The same markup works fine when i host my page on an apache server and even if i open it from the file system, and about a week ago it worked in a portlet over websphere appserver 7.0. All i have done on server side was adding video mime types for mp4, ogv, etc... other than that i have no idea what could have gone wrong.

Am i missing some settings on the server? Or if it is the issue with the ranged requests, how do you resolve that on websphere?

My code is like this:

<video preload="metadata" width="340">                      
<source src="video.webm" type="video/webm"  />  
<source src="video.mp4" type="video/mp4" />                     
<source src="video.ogv" type="video/ogg"  />
</video>

I start the video and set the loop attribute like this:

var $video = ...                            
if($video && $video.canPlayType) {
$video.play();
$video.loop = 1;
}

Thanks in advance for any answer!

4

1 回答 1

0

你试过做 HTML5 循环标签吗?

<video id="yourID" autoplay="autoplay" loop="loop">
<!--source code here-->
</video>

编辑:要让它从 JavaScript 工作,请执行以下操作。

var video = document.createElement('video'); //To create the video element.
video.loop = true;
于 2013-05-29T18:07:36.237 回答