I'm wanting to set attributes to HTML videos via (vanilla) Javascript. My platform is Tumblr, and as such I am unable to set the attributes directly to the video tag.
I'm currently using the script below, which works perfectly on most browsers (chrome, firefox and edge) but not on IE (and I am unable to check Safari at this stage). Using a script validator, I believe my problem is the "fat arrow" (=>
) syntax.
document.querySelectorAll('video').forEach((v) => {v.autoplay = false; v.muted = false; v.volume = 0.5; v.preload = false; v.loop = true;});
My biggest issue is because I have all my scripts merged into one, the "error" in the video script breaks all my other scripts (on IE).
Is there a way I can replace the "fat arrow", or is there another way to go about setting video attributes via Javascript?