Zohaib
Zohaib

Reputation: 196

Video is autoplay without autoplay and autostart attribute

http://www.biznabler.com/

Main page of website is video auto play. I am want to stop auto-play video.

I am trying below mention method, but not success.

document.getElementsByTagName("video")[0].removeAttribute("loop");
var x = document.getElementById("bgvid"); 
x.setAttribute('autostart','false');
x.setAttribute('preload','none');
x.setAttribute('autoPlay','false');
x.pause();

This is WordPress website, and I am able to insert own modified code. But do not find any method to stop video auto play.

Please help me

Upvotes: 1

Views: 144

Answers (1)

yuriy636
yuriy636

Reputation: 11661

In the code of your website, just after the <script> tag with the code you mention in your question you have another script that autostarts the video:

<script type="text/javascript" id="sns_scripts">
        var video = document.getElementById("bgvid");
        video.addEventListener("canplay", function() {
            setTimeout(function() {
                video.play();
            }, 1);
        });
</script>

Just get rid of that script(or comment our the .play() and you're done.

Upvotes: 1

Related Questions