I wrote a simple script to add an autoplay feature to a video streaming website
var vid = document.getElementById("my_video_1_html5_api");
var nxt = document.getElementById("Img2");
var ply = document.getElementsByClassName("vjs-big-play-button");
window.addEventListener('load', function () {
vid.play();
vid.requestFullscreen();
});
vid.onended = function() {
nxt.click();
};
I get the error: Failed to execute 'requestFullscreen' on 'Element': API can only be initiated by a user gesture.
it is running through the chrome extension Custom JavaScript for Websites
Is there a way to bypass this because its a local script and not part of the website or allow non-user gestures on this domain in chrome, or do I need to use something like auto hot key to press the fullscreen button?