feat(relive player): make player skip time to start configurable

This commit is contained in:
Andreas Hubel 2024-02-03 14:09:32 +01:00
parent e6438eba15
commit cc6bb04c90
No known key found for this signature in database
GPG key ID: 1291899EC534ECDE
5 changed files with 27 additions and 4 deletions

View file

@ -33,6 +33,14 @@ $(function() {
});
var $player = $('.video-wrap[data-voc-player]');
// skip forward to scheduled beginning of the talk at
var prerecord_seconds = 900;
if (window.config && window.config.features && window.config.features.relive && window.config.features.relive.prerecord) {
prerecord = window.config.features.relive.prerecord;
}
if ($player.length > 0) {
var config = {
parent: $player.get(0),
@ -59,7 +67,7 @@ $(function() {
// skip forward to scheduled beginning of the talk at
// ~ 0:14:30 (30 sec offset, if speaker starts on time)
} else if (playback.getPlaybackType() == 'vod') {
player.seek(15 * 60);
player.seek(prerecord_seconds);
}
});
}

View file

@ -18,7 +18,9 @@
"streamingConfig": {
"features": {
"embed": true,
"relive": true,
"relive": {
"prerecord": 300
},
"audio": false,
"sd_video": false,
"social": {

View file

@ -23,6 +23,11 @@ class Conference extends ModelBase
return $this->get('CONFERENCE.TITLE', 'C3VOC');
}
// only releavnt for new style config.json
public function getStreamingConfig() {
return null;
}
public function isPreviewEnabled() {
if(isset($GLOBALS['forceopen']) && $GLOBALS['forceopen'])
return true;

View file

@ -5,6 +5,7 @@ class ConferenceJson extends Conference
private $start;
private $end;
private $rooms;
private $streamingConfig;
private $html;
public function __construct($json, $mandator)
@ -13,7 +14,7 @@ class ConferenceJson extends Conference
$this->start = DateTime::createFromFormat(DateTimeInterface::ISO8601, $c->start);
$this->end = DateTime::createFromFormat(DateTimeInterface::ISO8601, $c->end);
$this->html = isset($c->streamingConfig->html) ? $c->streamingConfig->html : [];
$this->streamingConfig = $c->streamingConfig;
$this->rooms = [];
if (isset($c->rooms)) {
if (is_array($c->rooms)) {
@ -125,6 +126,10 @@ class ConferenceJson extends Conference
return false; // not supported by json schema
}
public function getStreamingConfig() {
return $this->streamingConfig;
}
public function getRooms()
{
$rooms = array();

View file

@ -72,7 +72,10 @@
<? else: ?>
<script type="text/javascript" src="<?=h($assets)?>mejs/mediaelement-and-player.min.js"></script>
<script type="text/javascript" src="<?=h($assets)?>voc-player/<?=$conference->get('PLAYER.VERSION') ?: 'player.umd.js?v=1.4.0-beta0'?>"></script>
<script type="text/javascript">window.Clappr = window.VOCPlayer</script>
<script type="text/javascript"> <!--
window.Clappr = window.VOCPlayer;
window.config = <?= json_encode($conference->getStreamingConfig(), JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE); ?>;
--> </script>
<script type="text/javascript" src="<?=h($assets)?>voc-player/clappr-thumbnails-plugin.js"></script>
<script type="text/javascript" src="<?=h($assets)?>voc-player/clappr-playback-rate-plugin.js"></script>
<script type="text/javascript" src="<?=h($assets)?>js/lustiges-script.js"></script>