Initial commit
This commit is contained in:
commit
65e0da7e11
1397 changed files with 596542 additions and 0 deletions
50
site/snippets/video-player.php
Normal file
50
site/snippets/video-player.php
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<?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()));
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Add table
Add a link
Reference in a new issue