From ff785d9ed55378263bf3b130bb473c815b20b637 Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Thu, 29 Dec 2016 00:33:22 +0100 Subject: add initial player --- assets/js/lustiges-script.js | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'assets/js') diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index 63227a3..56636b6 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -19,21 +19,20 @@ $(function() { features: ['playpause', 'volume', 'current'] }); - $('body.relive-player video.mejs').mediaelementplayer({ - mode: 'auto_plugin', - plugins: ['flash'], - flashName: 'flashmediaelement.swf', - pluginPath: '../assets/mejs/', - enableAutosize: true, - success: function (mediaElement) { - mediaElement.addEventListener('canplay', function () { - // skip forward to scheduled beginning of the talk at ~ 0:14:30 (30 sec offset, if speaker starts on time) - if ( mediaElement.currentTime == 0 ) { - mediaElement.setCurrentTime(870); - } - }) - } - }); + var $relivePlayer = $('body.relive-player .video-wrap'); + if($relivePlayer.length > 0) { + var player = new Clappr.Player({ + baseUrl: 'assets/clapprio/', + source: $relivePlayer.data('m3u8'), + height: $relivePlayer.data('height'), + width: $relivePlayer.data('width'), + /*vents: { + + }*/ + }); + + player.attachTo($relivePlayer.get(0)); + } $(window).on('load', function() { $(window).trigger('resize'); -- cgit v1.2.3 From bc34f86a390c85433b87e9ca8df4d5e5b67b2bda Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Thu, 29 Dec 2016 01:45:05 +0100 Subject: add autoseeking --- assets/js/lustiges-script.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'assets/js') diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index 56636b6..3e2df3c 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -26,9 +26,19 @@ $(function() { source: $relivePlayer.data('m3u8'), height: $relivePlayer.data('height'), width: $relivePlayer.data('width'), - /*vents: { - - }*/ + autoPlay: true, + events: { + onReady: function() { + window.player = player; + var playback = player.getPlugin('hls'); + playback.once(Clappr.Events.PLAYBACK_PLAY, function() { + if(player.getPlugin('hls').getPlaybackType() == 'vod') { + // skip forward to scheduled beginning of the talk at ~ 0:14:30 (30 sec offset, if speaker starts on time) + player.seek(14 * 60 + 30); + } + }); + } + } }); player.attachTo($relivePlayer.get(0)); -- cgit v1.2.3 From 7f0e67758967cace904fca142581176afca1272c Mon Sep 17 00:00:00 2001 From: Florian Larysch Date: Thu, 29 Dec 2016 01:51:44 +0100 Subject: fixup autoseek --- assets/js/lustiges-script.js | 1 - 1 file changed, 1 deletion(-) (limited to 'assets/js') diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js index 3e2df3c..81db426 100644 --- a/assets/js/lustiges-script.js +++ b/assets/js/lustiges-script.js @@ -29,7 +29,6 @@ $(function() { autoPlay: true, events: { onReady: function() { - window.player = player; var playback = player.getPlugin('hls'); playback.once(Clappr.Events.PLAYBACK_PLAY, function() { if(player.getPlugin('hls').getPlaybackType() == 'vod') { -- cgit v1.2.3