Answers for "if iframe play"

1

iframe autoplay

<!-- 
first add ?autoplay=1 to your video url
then add allow='autoplay' attribute to your iframe element
-->
<iframe src="https://www.youtube.com/embed/dQw4w9WgXcQ?autoplay=1" allow='autoplay'></iframe>
Posted by: Guest on June-23-2020
1

iframe get if video ended

<iframe src="https://player.vimeo.com/video/66966424" width="640" height="360" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>

<script src="https://player.vimeo.com/api/player.js"></script>
<script>

    var iframe = document.querySelector('iframe');
    var player = new Vimeo.Player(iframe);

    player.on('play', function() {
        alert('You have played the video')
    });
        player.on('ended', function(){
        alert('Video play completed');
    });

    player.getVideoTitle().then(function(title) {
        console.log('title:', title);
    });
</script>
Posted by: Guest on August-19-2021

Code answers related to "if iframe play"

Browse Popular Code Answers by Language