Search code examples
vimeovimeo-apioembed

How does one pause a Vimeo video without using an iframe


Viemo has an amazing API, but there doesn't seem to be a way to manually pause a video using JavaScript or oEmbeded. I've done a lot of research on this topic and there is a lot of stuff about playing and pausing vimeo videos in iframe, and somethings about video, but there isn't anything about pausing it using a oEmbed div.


Solution

  • Try with the below code.

    var iframe = document.querySelector('iframe');
    var player = new Vimeo.Player(iframe);
    <button onclick="return pause()">Pause </button>
    function pause(){
        player.pause();
    }