mirror of
https://github.com/voc/streaming-website
synced 2024-11-10 06:34:17 +00:00
Add poster image to live stream players
This commit is contained in:
parent
391dccbf84
commit
2b78ec78da
4 changed files with 13 additions and 6 deletions
|
@ -264,4 +264,7 @@ class Stream
|
|||
'opus' => 'Opus',
|
||||
);
|
||||
}
|
||||
public function getPoster() {
|
||||
return joinpath(['/', 'thumbs', rawurlencode($this->getRoom()->getStream()).'-poster.png']);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
<audio
|
||||
autoplay="autoplay"
|
||||
<video
|
||||
preload="auto"
|
||||
style="width: 300px;"
|
||||
class="mejs"
|
||||
controls="controls"
|
||||
autoplay="autoplay"
|
||||
style="height: 400px; display: block; margin: auto;"
|
||||
poster="<?=h($stream->getPoster())?>"
|
||||
>
|
||||
<source
|
||||
src="<?=h($stream->getAudioUrl('mp3'))?>"
|
||||
|
@ -12,4 +13,4 @@
|
|||
src="<?=h($stream->getAudioUrl('opus'))?>"
|
||||
type="audio/opus"
|
||||
/>
|
||||
</audio>
|
||||
</video>
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<script type="text/javascript" src="<?=h($assets)?>clapprio/level-selector.min.js"></script>
|
||||
<script type="text/javascript" src="<?=h($assets)?>clapprio/audio-selector.min.js"></script>
|
||||
|
||||
<div class="dashContainer">
|
||||
|
||||
<div class="dashContainer" style="min-height: 100px" >
|
||||
<div id="player"></div>
|
||||
</div>
|
||||
|
||||
|
@ -44,6 +45,7 @@
|
|||
return new Clappr.Player({
|
||||
sources: sources,
|
||||
width: "100%",
|
||||
poster: "<?=h($stream->getPoster())?>",
|
||||
plugins: [DashShakaPlayback, LevelSelector, AudioSelector],
|
||||
shakaConfiguration: {
|
||||
abr: {
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
preload="auto"
|
||||
width="<?=h($stream->getVideoWidth())?>"
|
||||
height="<?=h($stream->getVideoHeight())?>"
|
||||
poster="<?=h($stream->getPoster())?>"
|
||||
style="width: 100%; height: 100%;"
|
||||
class="mejs"
|
||||
>
|
||||
|
|
Loading…
Reference in a new issue