📅  最后修改于: 2022-03-11 14:55:59.083000             🧑  作者: Mango
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