null check to avoid occasional npe

edit
Hakim El Hattab 2016-07-04 13:32:03 +02:00
parent 6447b59ac5
commit ab2bb869a3
1 changed files with 15 additions and 11 deletions

View File

@ -3090,6 +3090,8 @@
var iframe = event.target;
if( iframe && iframe.contentWindow ) {
// YouTube postMessage API
if( /youtube\.com\/embed\//.test( iframe.getAttribute( 'src' ) ) && iframe.hasAttribute( 'data-autoplay' ) ) {
iframe.contentWindow.postMessage( '{"event":"command","func":"playVideo","args":""}', '*' );
@ -3105,6 +3107,8 @@
}
}
/**
* Stop playback of any embedded content inside of
* the targeted slide.