|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <?php
-
- namespace Modules;
-
- class CVideo extends ContentType {
-
- public $keys = array(
- 'TARGET' => 'target',
- 'STILL' => 'still',
- 'STILL2' => 'still2',
- 'NAME' => 'name',
- 'CAPTION' => 'caption',
- 'STYLE' => 'style',
- 'RATIO' => 'ratio'
- );
- public $values;
- protected $layout;
- protected $layouts = array(
- 'default' => 'view_default',
- 'lightbox' => 'view_in_lightbox',
- 'audio' => 'view_in_lightbox2'
- );
-
- function __construct($keys,$config) {
- parent::__construct($keys,$config);
- }
-
-
-
- function view_in_toc() {
- $v = (object) $this->values;
- return sprintf("<div class=\"location\"><a href=\"/%s\"><h3>%s</h3></a><span>%s</span></div>",
- $this->href,
- $v->name,
- $v->town
- );
- }
- function view_default() {
- $v = (object) $this->values;
- return sprintf("<video style=\"width:300px;\" id=\"asd\" class=\"video-js\" controls preload=\"auto\" "
- ."data-setup=\"{}\"><source src=\"%s%s\" /></video>",
- $this->config['path'],
- $v->target
- );
- }
-
- function view_in_lightbox1() {
- $v = (object) $this->values;
- $id = "video_".$v->name;
- return sprintf("<div class='video-container %s'><div class=\"media\"><div class=\"video-thumbnail\"><a href=\"%s\" data-featherlight=\"#%s\">"
- ."<img class=\"thumbnail\" src=\"%s\" alt=\"video-preview\"/>"
- ."<img class=\"play-button\" src=\"%s\" alt=\"play-button\" />"
- ."</a></div><div class=\"lightbox\" id=\"%s\" >%s</div></div><div class=\"caption\">%s</div></div>",
- $v->style,
- $v->target,
- $id,
- $v->still->get_src(1200),
- "/rsc/img/play-button.png",
- $id,
- $this->view_default(),
- $v->caption
- );
- }
- function view_in_lightbox() {
- $v = (object) $this->values;
- $id = $v->name;
- $target = $this->config['path'].$v->target;
- return sprintf("<div class='video-container %s'>"
- ."<div class=\"media\"><div class=\"video-thumbnail\"><a href=\"%s\" class=\"trigger_video\" data-poster=\"%s\" data-video-url=\"%s\" data-video-name=\"%s\" data-ce-type=\"video\">"
- ."<img class=\"thumbnail\" src=\"%s\" alt=\"video-preview\"/>"
- ."</a></div><div class=\"lightbox\" id=\"container%s\" ></div></div><div class=\"caption\">%s</div></div>",
- $v->style,
- $target,
- $v->still2,
- $target,
- $id,
- $v->still->get_src(1200),
- $id,
- $v->caption
- );
- }
- function view_in_lightbox2() {
- $v = (object) $this->values;
- $id = $v->name;
- $target = $this->config['path'].$v->target;
- return sprintf("<div class='audio-container %s'>"
- ."<div class=\"media\"><div class=\"video-thumbnail\"><a href=\"%s\" class=\"trigger_video\" data-video-url=\"%s\" data-video-name=\"%s\" data-ce-type=\"audio\" data-ratio=\"%s\">"
- ."<img class=\"thumbnail\" src=\"%s\" alt=\"video-preview\"/>"
- ."</a></div><div class=\"lightbox\" id=\"container%s\" ></div></div><div class=\"caption\">%s</div></div>",
- $v->style,
- $target,
- //$v->still2,
- $target,
- $id,
- $v->ratio,
- $v->still->get_src(1200),
- $id,
- $v->caption
- );
- }
-
- }
|