1

Hello Could you please help me with this. I want the video to load and auto play but I want a 5 second delay when it starts playing.

Could you please help with the js.

<div class="wistia_embed" id="wistia_8j11ui3tfw"> </div>
    <script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/E-v1.js" type="text/javascript">
    </script>
    <script type="text/javascript">
    wistiaEmbed = Wistia.embed("8j11ui3tfw", {
    volume: 0,
    wmode: "transparent",
    playbar: false,
    smallPlayButton: false,
    volumeControl: false,
    fullscreenButton: false,
    videoFoam: true,
    playerPreference: "html5"
    });
    setTimeout(function(){
    document.getElementById("wistia_8j11ui3tfw").play();
    }, 5000);
    }
    });
    </script>

1 Answers1

0

Its done, check this.

<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
    </head>
    <div class="wistia_embed" id="wistia_8j11ui3tfw"> </div>
    <script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/E-v1.js" type="text/javascript">
    </script>
    <script type="text/javascript">
        $(document).ready(function () {
        wistiaEmbed = Wistia.embed("8j11ui3tfw", {
            volume: 0,
            wmode: "transparent",
            playbar: false,
            smallPlayButton: false,
            volumeControl: false,
            fullscreenButton: false,
            videoFoam: true,
            playerPreference: "html5"
        });

        setTimeout(function(){
            wistiaEmbed.play(); 
        }, 5000);

        });
    </script>
</html>
Punit Gajjar
  • 4,937
  • 7
  • 35
  • 70