public function getVideoHtml() { $video = $this->getVideo(); $player = new JWPlayer(); $player->setHtml5PlayerUrl($this->getDispatchUrl('jwplayer.html5.js')); $player->setFlashPlayerUrl($this->getDispatchUrl('jwplayer.flash.swf')); $player->setVideoUrl($video->url); if ($video->getCaptions()) { $player->addCaptionConfig(sprintf('/video/captions/%d.vtt', $video->id()), 'On', true); } return $player->getHtml(); }
public function getVideoHtml() { $player = new JWPlayer(); $player->setHtml5PlayerUrl($this->getDispatchUrl('/jwplayer.html5.js')); $player->setFlashPlayerUrl($this->getDispatchUrl('/jwplayer.flash.swf')); $player->setWidth(480); $player->setVideoUrl($this->_video->url); if ($this->_video->getCaptions()) { $player->addCaptionConfig(sprintf('/video/captions/%d.vtt', $this->_video->id()), 'On', true); } $this->videoElementId = $player->getElementId(); return $player->getHtml(); }