aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Schubert2017-07-07 20:17:27 +0200
committerAnton Schubert2017-07-07 20:17:27 +0200
commitd78310ddf710724395665418bbcbeae60c6e9fed (patch)
tree14426061369295e2c8e8ab9d5023638e669bfa11
parent0b65741d437caead463dc2a6cc0a047161a2245e (diff)
add initial seeking to relive player
-rw-r--r--assets/js/lustiges-script.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/assets/js/lustiges-script.js b/assets/js/lustiges-script.js
index e949c6e..ad3ccab 100644
--- a/assets/js/lustiges-script.js
+++ b/assets/js/lustiges-script.js
@@ -1,5 +1,18 @@
// mediaelement-player
$(function() {
+ function deserialize(string) {
+ var result = {};
+ if (string) {
+ var parts = string.split(/&|\?/);
+ for (var i = 0; i < parts.length; i++) {
+ var part = parts[i].split("=");
+ if (part.length === 2)
+ result[decodeURIComponent(part[0])] = decodeURIComponent(part[1]);
+ }
+ }
+ return result;
+ }
+
(function(strings) {
strings['en-US'] = {
'Download File': 'Open Stream in Desktop-Player'
@@ -45,8 +58,13 @@ $(function() {
events: {
onReady: function() {
var playback = player.getPlugin('hls');
+ var params = deserialize(location.href)
+
playback.once(Clappr.Events.PLAYBACK_PLAY, function() {
- if(player.getPlugin('hls').getPlaybackType() == 'vod') {
+ var seek = parseFloat(params.t);
+ if (!isNaN(seek)) {
+ player.seek(seek);
+ } else 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);
}