コード例 #1
0
 private function _getDataUrl(tubepress_api_media_MediaItem $mediaItem)
 {
     $link = $this->_urlFactory->fromString('https://www.youtube.com/embed/' . $mediaItem->getId());
     $embedQuery = $link->getQuery();
     $url = $this->_urlFactory->fromCurrent();
     $origin = $url->getScheme() . '://' . $url->getHost();
     $autoPlay = $this->_context->get(tubepress_api_options_Names::EMBEDDED_AUTOPLAY);
     $loop = $this->_context->get(tubepress_api_options_Names::EMBEDDED_LOOP);
     $showInfo = $this->_context->get(tubepress_api_options_Names::EMBEDDED_SHOW_INFO);
     $autoHide = $this->_context->get(tubepress_youtube3_api_Constants::OPTION_AUTOHIDE);
     $fullscreen = $this->_context->get(tubepress_youtube3_api_Constants::OPTION_FULLSCREEN);
     $modestBranding = $this->_context->get(tubepress_youtube3_api_Constants::OPTION_MODEST_BRANDING);
     $showRelated = $this->_context->get(tubepress_youtube3_api_Constants::OPTION_SHOW_RELATED);
     $embedQuery->set('autohide', $this->_getAutoHideValue($autoHide));
     $embedQuery->set('autoplay', $this->_langUtils->booleanToStringOneOrZero($autoPlay));
     $embedQuery->set('enablejsapi', '1');
     $embedQuery->set('fs', $this->_langUtils->booleanToStringOneOrZero($fullscreen));
     $embedQuery->set('modestbranding', $this->_langUtils->booleanToStringOneOrZero($modestBranding));
     $embedQuery->set('origin', $origin);
     $embedQuery->set('rel', $this->_langUtils->booleanToStringOneOrZero($showRelated));
     $embedQuery->set('showinfo', $this->_langUtils->booleanToStringOneOrZero($showInfo));
     $embedQuery->set('wmode', 'opaque');
     if ($loop) {
         $embedQuery->set('loop', $this->_langUtils->booleanToStringOneOrZero($loop));
         $embedQuery->set('playlist', $mediaItem->getId());
     }
     return $link;
 }
コード例 #2
0
 private function _getDataUrl(tubepress_api_media_MediaItem $mediaItem, $playerId)
 {
     $autoPlay = $this->_context->get(tubepress_api_options_Names::EMBEDDED_AUTOPLAY);
     $showInfo = $this->_context->get(tubepress_api_options_Names::EMBEDDED_SHOW_INFO);
     $actualId = str_replace('dailymotion_', '', $mediaItem->getId());
     /* build the data URL based on these options */
     $link = $this->_urlFactory->fromString("https://www.dailymotion.com/embed/video/{$actualId}");
     $query = $link->getQuery();
     $query->set(self::$_URL_PARAM_AUTOPLAY, $this->_langUtils->booleanToStringOneOrZero($autoPlay));
     $query->set(self::$_URL_PARAM_UI_START_SCREEN, $this->_langUtils->booleanToStringOneOrZero($showInfo));
     $query->set(self::$_URL_PARAM_ID, $playerId);
     return $link;
 }
コード例 #3
0
 private function _getDataUrl(tubepress_api_media_MediaItem $mediaItem)
 {
     $autoPlay = $this->_context->get(tubepress_api_options_Names::EMBEDDED_AUTOPLAY);
     $showInfo = $this->_context->get(tubepress_api_options_Names::EMBEDDED_SHOW_INFO);
     $loop = $this->_context->get(tubepress_api_options_Names::EMBEDDED_LOOP);
     $color = $this->_context->get(tubepress_vimeo3_api_Constants::OPTION_PLAYER_COLOR);
     /* build the data URL based on these options */
     $link = $this->_urlFactory->fromString('https://player.vimeo.com/video/' . $mediaItem->getId());
     $query = $link->getQuery();
     $query->set(self::$_URL_PARAM_AUTOPLAY, $this->_langUtils->booleanToStringOneOrZero($autoPlay));
     $query->set(self::$_URL_PARAM_COLOR, $color);
     $query->set(self::$_URL_PARAM_LOOP, $this->_langUtils->booleanToStringOneOrZero($loop));
     $query->set(self::$_URL_PARAM_PORTRAIT, $this->_langUtils->booleanToStringOneOrZero($showInfo));
     $query->set(self::$_URL_PARAM_BYLINE, $this->_langUtils->booleanToStringOneOrZero($showInfo));
     $query->set(self::$_URL_PARAM_TITLE, $this->_langUtils->booleanToStringOneOrZero($showInfo));
     return $link;
 }