Why does setting currentTime of HTML5 video element reset time in Chrome? Why does setting currentTime of HTML5 video element reset time in Chrome? google-chrome google-chrome

Why does setting currentTime of HTML5 video element reset time in Chrome?


I finally figured out an answer! Chrome requires you to set the currentTime as a String, and not as a number.

function settime() {    var video = document.getElementById("video1");    console.log(video.currentTime); // output 0    video.currentTime = 10.0;    console.log(video.currentTime); // output 0 for some chrome users or 10 for firefox and others    video.currentTime = "10.0";    console.log(video.currentTime); // output 10}settime();
<audio id="video1" src="https://sample-videos.com/audio/mp3/crowd-cheering.mp3" controls></audio><div>Click play to start the audio at 10 s.</div>