Answers for "stop autoplay embed video html iframe"

1

disable autoplay in html iframe

<iframe width="{$width}" height="{$height}" src="http://blank.com/embed/{$id}" allowfullscreen="" controls="" autoplay="" frameborder="0" scrolling="no"></iframe>
<iframe width="{$width}" height="{$height}" src="http://blank.com/embed/{$id}" allowfullscreen="" controls="controls" autoplay="false" frameborder="0" scrolling="no"></iframe>
<iframe width="{$width}" height="{$height}" src="http://blank.com/embed/{$id}" allowfullscreen="" controls="0" autoplay="0" frameborder="0" scrolling="no"></iframe>
Posted by: Guest on October-25-2020
0

how to stop iframe video using javascript

var stopVideo = function ( element ) {
    var iframe = element.querySelector( 'iframe');
    var video = element.querySelector( 'video' );
    if ( iframe !== null ) {
        var iframeSrc = iframe.src;
        iframe.src = iframeSrc;
    }
    if ( video !== null ) {
        video.pause();
    }
};
Posted by: Guest on September-03-2021

Browse Popular Code Answers by Language