Implement video upload to posts
This commit is contained in:
@@ -110,7 +110,8 @@
|
||||
'lib/jquery.PageScroll2id.min.js',
|
||||
'lib/jquery.mobile.custom.min.js',
|
||||
'post-create.js',
|
||||
'post-item.js'
|
||||
'post-item.js',
|
||||
'video-controls.js',
|
||||
];
|
||||
if (isset($additionalScripts)) {
|
||||
$scripts = array_merge($scripts, $additionalScripts);
|
||||
|
@@ -35,11 +35,46 @@
|
||||
|
||||
<?php if (!empty($media)): ?>
|
||||
<div class="post-media-list row">
|
||||
<?php foreach ($media as $item): ?>
|
||||
<div class="col">
|
||||
<div class="post-media" data-full-image="<?= $item['mediaUrl'] ?>" style="background-image: url(<?= $item['mediaUrl'] ?>?w=500"></div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($media as $item) {
|
||||
$url = '/f/' . $item['name'];
|
||||
switch ($item['type']) {
|
||||
case 'image':
|
||||
?>
|
||||
<div class="col">
|
||||
<div class="post-media post-image" data-full-image="<?= $url ?>" style="background-image: url('<?= $url ?>?w=500')"></div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
case 'video':
|
||||
?>
|
||||
<div class="col">
|
||||
<div class="video-container">
|
||||
<video class="video" src="<?= $url ?>" muted></video>
|
||||
<div class="video-controls">
|
||||
<button type="button" class="video-control-btn video-toggle-play">
|
||||
<i class="fa fa-play"></i>
|
||||
</button>
|
||||
<div class="video-volume-container">
|
||||
<button type="button" class="video-control-btn video-mute">
|
||||
<i class="fa fa-volume-muted"></i>
|
||||
</button>
|
||||
<input type="range" class="video-volume" min="0" max="1" step="0.1" value="1">
|
||||
</div>
|
||||
<output class="video-time">0:00</output>
|
||||
<input type="range" class="video-seek-bar" value="0">
|
||||
<output class="video-length">0:00</output>
|
||||
<button type="button" class="video-control-btn video-fullscreen">
|
||||
<i class="fa fa-expand"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
break;
|
||||
case 'audio':
|
||||
break;
|
||||
}
|
||||
} ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user