aboutsummaryrefslogtreecommitdiff
path: root/assets/js
diff options
context:
space:
mode:
authorMaZderMind2016-12-29 02:27:48 +0100
committerMaZderMind2016-12-29 02:27:48 +0100
commit5faaebf0454e2d35b5fccc55ef9685328680f780 (patch)
tree1054d3ea270b749215b4d381020e4ae014b8e5e9 /assets/js
parentb802ead38b52fa2306b480572518da20687d0d94 (diff)
parentca2b184b87dba5c0f382332116b277d5ed156878 (diff)
Merge branch 'feature/relive-js' into events/33c3
Diffstat (limited to '')
-rw-r--r--assets/js/lustiges-script.js36
1 files changed, 22 insertions, 14 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js
index 63227a3..81db426 100644
--- a/assets/js/lustiges-script.js
+++ b/assets/js/lustiges-script.js
@@ -19,21 +19,29 @@ $(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'),
+ autoPlay: true,
+ events: {
+ onReady: function() {
+ 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));
+ }
$(window).on('load', function() {
$(window).trigger('resize');