Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JS currentTime for html video tag is not working on chrome

I want to capture the current run time of a HTML5 video when a specific button is clicked. Here is my code

var vid = document.getElementById("video1");    
$('#cap-cue').click(function(){
    var curtime = vid.currentTime;
    alert(curtime);
});

This is working perfectly for most of the browsers but not working on chrome.

like image 827
user3917039 Avatar asked Jan 15 '15 13:01

user3917039


1 Answers

The problem (at least regarding Chrome) is probably on the server side. Put Header set Accept-Ranges bytes in your .htaccess (see this answer)

like image 107
yPhil Avatar answered Sep 20 '22 23:09

yPhil