From 2b78ec78daa0dd4a0d9c9f8a892a3c8faa9d2690 Mon Sep 17 00:00:00 2001 From: Andreas Hubel Date: Fri, 28 Dec 2018 17:38:23 +0100 Subject: Add poster image to live stream players --- model/Stream.php | 3 +++ template/assemblies/player/audio.phtml | 11 ++++++----- template/assemblies/player/dash.phtml | 4 +++- template/assemblies/player/video.phtml | 1 + 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/model/Stream.php b/model/Stream.php index 718ed98..d577df6 100644 --- a/model/Stream.php +++ b/model/Stream.php @@ -264,4 +264,7 @@ class Stream 'opus' => 'Opus', ); } + public function getPoster() { + return joinpath(['/', 'thumbs', rawurlencode($this->getRoom()->getStream()).'-poster.png']); + } } diff --git a/template/assemblies/player/audio.phtml b/template/assemblies/player/audio.phtml index 087b61c..0713f20 100644 --- a/template/assemblies/player/audio.phtml +++ b/template/assemblies/player/audio.phtml @@ -1,8 +1,9 @@ - + diff --git a/template/assemblies/player/dash.phtml b/template/assemblies/player/dash.phtml index 8e43864..7cc1e38 100644 --- a/template/assemblies/player/dash.phtml +++ b/template/assemblies/player/dash.phtml @@ -2,7 +2,8 @@ -
+ +
@@ -44,6 +45,7 @@ return new Clappr.Player({ sources: sources, width: "100%", + poster: "getPoster())?>", plugins: [DashShakaPlayback, LevelSelector, AudioSelector], shakaConfiguration: { abr: { diff --git a/template/assemblies/player/video.phtml b/template/assemblies/player/video.phtml index ff5039b..3eae170 100644 --- a/template/assemblies/player/video.phtml +++ b/template/assemblies/player/video.phtml @@ -10,6 +10,7 @@ preload="auto" width="getVideoWidth())?>" height="getVideoHeight())?>" + poster="getPoster())?>" style="width: 100%; height: 100%;" class="mejs" > -- cgit v1.2.3