* */ class TimedMediaIframeOutput { /** * The iframe hook check file pages embedplayer=yes * @param $title Title * @param $article Article * @param bool $doOutput * @return bool */ static function iframeHook( &$title, &$article, $doOutput = true ) { global $wgRequest, $wgOut, $wgEnableIframeEmbed; if( !$wgEnableIframeEmbed ) return true; //continue normal output iframes are "off" (maybe throw a warning in the future) // Make sure we are in the right namespace and iframe=true was called: if( is_object( $title ) && $title->getNamespace() == NS_FILE && $wgRequest->getVal('embedplayer') == 'yes' && $wgEnableIframeEmbed && $doOutput ){ if ( self::outputIframe( $title ) ) { // Turn off output of anything other than the iframe $wgOut->disable(); } } return true; } /** * Output an iframe * @param $title Title * @throws Exception */ static function outputIframe( $title ) { global $wgEnableIframeEmbed, $wgOut, $wgUser, $wgBreakFrames; if( !$wgEnableIframeEmbed ){ return false; } // Setup the render parm $file = wfFindFile( $title ); if ( !$file ) { // file was removed, show wiki page with warning return false; } $params = array( 'fillwindow' => true ); $videoTransform = $file->transform( $params ); // Definitely do not want to break frames $wgBreakFrames = false; $wgOut->allowClickjacking(); $wgOut->addModules( array( 'embedPlayerIframeStyle', 'mw.EmbedPlayer' ) ); $wgOut->sendCacheControl(); ?> <?php echo $title->getText() ?> 'ResourceLoaderDynamicStyles', 'content' => '' ) ); ?> getHeadLinksArray() ); echo implode( "\n", $wgOut->getHeadLinksArray() ); ?> getHeadScripts(); ?> getBottomScripts(); ?>