/** * @param Video $video * @return string */ function renderPlayer(Video $video) { return '<div id="wistia_' . $video->getProperty('wistia_code') . '" class="wistia_embed" style="width:640px;height:360px;"> </div> <script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/E-v1.js"></script> <script> wistiaEmbed = Wistia.embed("' . $video->getProperty('wistia_code') . '", { videoFoam: true }); if (location.href.indexOf("index.html") === -1) { wistiaEmbed.play(); } </script>'; }
/** * @param string $locale * @return Video[]|NamedList */ function getVideos($locale = null) { if (empty($locale)) { $locale = $this->project->getDefaultLocale(); } if ($this->videos === false) { $files = call_user_func($this->finders['findVideoFiles'], $this->getVideosPath($locale), $locale); $this->videos = new NamedList(); foreach ($files as $file) { $video = new Video($this->project, $file); if ($video->isLoaded()) { $this->videos->add($video->getShortName(), $video); } } } return $this->videos; }
/** * Return book page URL * * @param string $book_name * @param string $page_slug * @return string */ private static function getBookPageUrl($book_name, $page_slug) { return self::pageLevelToPrefix(self::$current_element->getPageLevel()) . 'books/' . $book_name . '/' . $page_slug . '.html'; }