This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const video = document.createElement('video'); | |
video.muted = true; // exactly this way, otherwise it won't play in chrome. Thanks, @msagolj for the tip! | |
video.toggleAttribute('autoplay', true); | |
video.toggleAttribute('loop', true); | |
video.toggleAttribute('playsinline', true); | |
const source = document.createElement('source'); | |
source.setAttribute('src', entry[2]); | |
source.setAttribute('type', 'video/mp4'); |