Denis
Denis

Reputation: 2314

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.

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

var video = document.getElementById("videoPlayer"), (HTML5 <video *.mp4>)
newprogressBar = document.getElementById("newprogressBar");
newprogress = document.getElementById("newprogress");

Event function in 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

video.currentTime = Math.round(x * video.duration);

Error:

TypeError: Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value.

Upvotes: 0

Views: 3944

Answers (1)

purplemind
purplemind

Reputation: 71

Check for .webm video file within video tag. Firefox on linux (also maybe on other OS) doesn't play .mp4 files.

Upvotes: 1

Related Questions