Answers for "how to stop youtube video for ionic"

0

how to stop youtube video for ionic

ionViewWillLeave() {
    let listaFrames = document.getElementsByTagName("iframe");
    for (var index = 0; index < listaFrames.length; index++) {
        let iframe = listaFrames[index].contentWindow;          
        iframe.postMessage('{"event":"command","func":"pauseVideo","args":""}', '*');
     }
}

//Don't forget to enable JS at the end of the video link *?enablejsapi=1
Posted by: Guest on May-21-2020

Code answers related to "how to stop youtube video for ionic"

Browse Popular Code Answers by Language