summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPerflyst <mail@perflyst.de>2021-02-26 19:59:23 +0100
committerGitHub <noreply@github.com>2021-02-26 19:59:23 +0100
commit489d0151ad0e72b875729b4a7839cc0df2692571 (patch)
treea08ed416fd6e447be01a0ed2f54463602da8f5d9
parent1a78bb4b587e76da1f2c6c5f7313b29174039218 (diff)
parentbcb44ab6008f22249a4c3d03883b6a31697dd773 (diff)
downloadinvidious-489d0151ad0e72b875729b4a7839cc0df2692571.tar.gz
invidious-489d0151ad0e72b875729b4a7839cc0df2692571.tar.bz2
invidious-489d0151ad0e72b875729b4a7839cc0df2692571.zip
Merge pull request #1735 from 138138138/patch-1
iOS audio mode double duration fix
-rw-r--r--assets/js/player.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/assets/js/player.js b/assets/js/player.js
index 4db6f98d..1c6e336c 100644
--- a/assets/js/player.js
+++ b/assets/js/player.js
@@ -554,4 +554,15 @@ if (player_data.preferred_caption_found) {
player.ready(() => {
player.textTracks()[1].mode = 'showing';
});
-} \ No newline at end of file
+}
+
+// Safari audio double duration fix
+if (navigator.vendor == "Apple Computer, Inc." && video_data.params.listen) {
+ player.on('loadedmetadata', function () {
+ player.on('timeupdate', function () {
+ if (player.remainingTime() < player.duration() / 2) {
+ player.currentTime(player.duration() + 1);
+ }
+ });
+ });
+}