From 033583dfddac9df80a74d6d3f8cf6f1dcdfbb511 Mon Sep 17 00:00:00 2001 From: Mateusz Najdek Date: Fri, 10 Dec 2021 10:20:20 +0100 Subject: [PATCH] Fixed dash live streams starting from beginning --- f1tv_plus.user.js | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/f1tv_plus.user.js b/f1tv_plus.user.js index 43b0693..e43a899 100644 --- a/f1tv_plus.user.js +++ b/f1tv_plus.user.js @@ -1,7 +1,7 @@ // ==UserScript== // @name F1TV+ // @namespace https://najdek.github.io/f1tv_plus/ -// @version 2.2.1 +// @version 2.2.2 // @description A few improvements to F1TV // @author Mateusz Najdek // @match https://f1tv.formula1.com/* @@ -14,8 +14,8 @@ (function() { 'use strict'; - var smVersion = "2.2.1"; - //- Fixed seeking in dash live streams + var smVersion = "2.2.2"; + //- Fixed seeking in dash live streams
- Fixed dash live streams starting from beginning
var smUpdateUrl = "https://raw.githubusercontent.com/najdek/f1tv_plus/master/f1tv_plus.user.js"; var smSyncDataUrl = "https://raw.githubusercontent.com/najdek/f1tv_plus/master/sync_offsets.json"; @@ -857,6 +857,17 @@ $("#sm-video-seekbar").data("start", seekRange.start); $("#sm-video-seekbar").data("end", seekRange.end); + if (smPlayer.isLive()) { + function waitForVideo() { + if (document.getElementById("sm-popup-video").readyState > 0) { + smPlayer.goToLive(); + } else { + setTimeout(waitForVideo, 100); + } + } + waitForVideo(); + } + document.getElementById("sm-popup-video").play(); document.getElementById("sm-audio-tracks").innerHTML = "
Audio track
"; document.getElementById("sm-levels").innerHTML = "
Video quality
";