aboutsummaryrefslogtreecommitdiff
path: root/assets
diff options
context:
space:
mode:
authortdro <tdro@noreply.example.com>2024-01-13 20:33:21 -0500
committertdro <tdro@noreply.example.com>2024-01-13 20:33:21 -0500
commite3f2fd696060de3d6f70c6eab77bd5d358c82c87 (patch)
tree08611d5db03e8d0089c854b79e9262a354616856 /assets
parent8b53662def693a97ee5e0b5697841cf7859b6704 (diff)
downloadcanory-e3f2fd696060de3d6f70c6eab77bd5d358c82c87.tar.gz
canory-e3f2fd696060de3d6f70c6eab77bd5d358c82c87.tar.bz2
canory-e3f2fd696060de3d6f70c6eab77bd5d358c82c87.zip
static/js/autoplay: Set attributes
Some browsers only understand attributes
Diffstat (limited to 'assets')
-rw-r--r--assets/js/index.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/assets/js/index.js b/assets/js/index.js
index ef35f63..491cf59 100644
--- a/assets/js/index.js
+++ b/assets/js/index.js
@@ -607,14 +607,19 @@
"DOMContentLoaded"
].forEach(function(event) {
self.addEventListener(event, function() {
- const videos = document.querySelectorAll("video");
let first = true;
+ let videos = document.querySelectorAll("video");
for(i = 0; i < videos.length; i++){
videos[i].autoplay = true;
videos[i].controls = true;
videos[i].loop = true;
videos[i].muted = true;
videos[i].playsinline = true;
+ videos[i].setAttribute("autoplay", true);
+ videos[i].setAttribute("controls", true);
+ videos[i].setAttribute("loop", true);
+ videos[i].setAttribute("muted", true);
+ videos[i].setAttribute("playsinline", true);
const onscreen = viewport(videos[i]);
if (first && onscreen) {
videos[i].play();