Hello im trying to set a volume to a video!
When i try to set the volume like this:
myVideoElement.volume = 0.801; // Is working fine!
But when i try to set the volume like this:
var volumeToSet = Math.floor(myPrcent * 10) / 1000;
myVideoElement.volume = volumeToSet;
I get this error:
How can fix that?
Ok solved! I trying before to find the percentage of the video volume with:
var percent = Math.floor((left / Math.floor(myVideoElement.volume * 10) / 10) * 100);
The Math.floor() function makes my number infinity!
I've received similar error when I was using IntersectionObserver
. It turned out that the entries
according to the documentation have to be less than 1
. Somehow I put 2.5345453453
as an entry and got this error.
I hope it'll help someone as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With