50 lines
1.5 KiB
PHP
50 lines
1.5 KiB
PHP
<?php
|
|
if ($image) {
|
|
|
|
$poster = $image->resize(1000)->url();
|
|
$video = null;
|
|
|
|
if ($image->laptopvideo()->isNotEmpty() ||
|
|
$image->laptopvideo()->isNotEmpty() ||
|
|
$image->monitorvideo()->isNotEmpty()) {
|
|
|
|
|
|
$attributes = [
|
|
'class' => 'video-player',
|
|
'poster' => $poster,
|
|
'height' => '100%',
|
|
'width' => 'auto',
|
|
'playsinline' => 'true',
|
|
'preload' => 'auto'
|
|
];
|
|
|
|
// $source = '<source style="display: none;" src=' . $image->laptopvideo()->toFile() . ' type="video/mp4">';
|
|
|
|
$video = '<video
|
|
class="video-player"
|
|
poster="' . $poster . '"
|
|
height="100%"
|
|
width="auto"
|
|
playsinline="true"
|
|
preload="auto"
|
|
' . ($image->mobilevideo()->isNotEmpty() ? 'data-mobile="' . $image->mobilevideo()->toFile() . '"' : '') . '
|
|
' . ($image->monitorvideo()->isNotEmpty() ? 'data-monitor="' . $image->monitorvideo()->toFile() . '"' : '') . '
|
|
' . ($image->laptopvideo()->isNotEmpty() ? 'data-laptop="' . $image->laptopvideo()->toFile() . '"' : '') . '
|
|
></video>';
|
|
|
|
|
|
$playCursor = '<div class="play-cursor video-cursor"></div>';
|
|
$pauseCursor = '<div class="pause-cursor video-cursor"></div>';
|
|
$seekBar = '<div class="seekbar"><div class="thumb"></div></div>';
|
|
|
|
$videoContainer = '<div class="artist-image video-container">' . $video . $playCursor . $pauseCursor . $seekBar . '</div>';
|
|
|
|
echo $videoContainer;
|
|
}
|
|
else {
|
|
|
|
snippet('responsive-image', array('image' => $image->thumb()));
|
|
|
|
}
|
|
}
|
|
?>
|