/** gets any defiend on-page uiConf js */ private function getPerUiConfJS() { if (!$this->request()->get('uiconf_id') || !$this->getUiConfObject() || !$this->request()->get('wid') && !$this->request()->get('p')) { // directly issue the UiConfJs callback return 'kWidget.inLoaderUiConfJsCallback();'; } // load the onPage js services $mweUiConfJs = new mweApiUiConfJs(); // output is set to empty string: $o = ''; // always include UserAgentPlayerRules: $o .= $mweUiConfJs->getUserAgentPlayerRules(); // support including special player rewrite flags if set in uiConf: if ($this->getUiConfObject()->getPlayerConfig(null, 'Kaltura.LeadWithHTML5') === true || $this->getUiConfObject()->getPlayerConfig(null, 'KalturaSupport.LeadWithHTML5') === true) { $o .= "\n" . "kWidget.addUserAgentRule('{$this->request()->get('uiconf_id')}', '/.*/', 'leadWithHTML5');"; } if ($this->getUiConfObject()->getPlayerConfig(null, 'Kaltura.ForceFlashOnIE10') === true) { $o .= "\n" . 'mw.setConfig(\'Kaltura.ForceFlashOnIE10\', true );' . "\n"; } if ($this->getUiConfObject()->isJson()) { $o .= "\n" . "kWidget.addUserAgentRule('{$this->request()->get('uiconf_id')}', '/.*/', 'leadWithHTML5');"; } // If we have entry data if ($this->request()->get('entry_id')) { global $container, $wgExternalPlayersSupportedTypes; try { $entryResult = $container['entry_result']; $entry = $entryResult->getResult(); $metaData = @get_object_vars($entry['meta']); if (isset($metaData["externalSourceType"])) { if (in_array(strtolower($metaData["externalSourceType"]), array_map('strtolower', $wgExternalPlayersSupportedTypes))) { $o .= "\n" . 'mw.setConfig(\'forceMobileHTML5\', true );' . "\n"; } } } catch (Exception $e) { // } } // Only include on page plugins if not in iframe Server if (!isset($_REQUEST['iframeServer'])) { $o .= $mweUiConfJs->getPluginPageJs('kWidget.inLoaderUiConfJsCallback'); } else { $o .= 'kWidget.inLoaderUiConfJsCallback();'; } // set the flag so that we don't have to request the services.php $o .= "\n" . 'kWidget.uiConfScriptLoadList[\'' . $this->request()->get('uiconf_id') . '\'] = 1; '; return $o; }
/** gets any defiend on-page uiConf js */ private function getPerUiConfJS() { if (!$this->getResultObject() || !isset($this->getResultObject()->urlParameters['uiconf_id']) || !isset($this->getResultObject()->urlParameters['wid']) && !isset($this->getResultObject()->urlParameters['p'])) { // directly issue the UiConfJs callback return 'kWidget.inLoaderUiConfJsCallback();'; } // load the onPage js services $mweUiConfJs = new mweApiUiConfJs(); // output is set to empty string: $o = ''; // always include UserAgentPlayerRules: $o .= $mweUiConfJs->getUserAgentPlayerRules(); // support including special player rewrite flags if set in uiConf: if ($this->getResultObject()->getPlayerConfig(null, 'Kaltura.LeadWithHTML5') === true) { $o .= "\n" . 'mw.setConfig(\'Kaltura.LeadWithHTML5\', true );'; } if ($this->getResultObject()->getPlayerConfig(null, 'Kaltura.ForceFlashOnIE10') === true) { $o .= "\n" . 'mw.setConfig(\'Kaltura.ForceFlashOnIE10\', true );' . "\n"; } // Only include on page plugins if not in iframe Server if (!isset($_REQUEST['iframeServer'])) { $o .= $mweUiConfJs->getPluginPageJs('kWidget.inLoaderUiConfJsCallback'); } else { $o .= 'kWidget.inLoaderUiConfJsCallback();'; } // set the flag so that we don't have to request the services.php $o .= "\n" . 'kWidget.uiConfScriptLoadList[\'' . $mweUiConfJs->getResultObject()->urlParameters['uiconf_id'] . '\'] = 1; '; return $o; }