[英]Error In Mozilla Firefox.
I write HTML/JS code for HTML5 video player and have a error in Firefox 27.0.1 version, In Ubuntu/Windows Chrome in works, in IE11 it works. 我为HTML5视频播放器编写了HTML / JS代码,并且在Firefox 27.0.1版本中出现错误,在Ubuntu / Windows Chrome浏览器中有效,在IE11中运行。
HTML HTML
<div id="newprogressBar" style="border:1px solid #aaa; color:#fff; width:295px; height:20px;"><span id="newprogress" style="background-color:#ff0000; height:20px; display:inline-block;"></span></div>
JS in HTML HTML中的JS
var video = document.getElementById("videoPlayer"), (HTML5 <video *.mp4>)
newprogressBar = document.getElementById("newprogressBar");
newprogress = document.getElementById("newprogress");
Event function in JS JS中的事件函数
newprogressBar.addEventListener('click', function(event) {
width = parseFloat(newprogressBar.style.width);
var x = event.offsetX / width;
video.currentTime = Math.round(x * video.duration);
}, false);
I have an error on this line in Firefox 我在Firefox的这一行有一个错误
video.currentTime = Math.round(x * video.duration);
Error: 错误:
TypeError: Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value.
Check for .webm video file within video tag. 检查video标签内的.webm视频文件。 Firefox on linux (also maybe on other OS) doesn't play .mp4 files.
Linux(也可能是其他操作系统)上的Firefox无法播放.mp4文件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.