From 9eccae74c844f09e9e3483db623fea00e0562365 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 19 Aug 2020 16:14:25 +0200 Subject: Try to fix autoplay with ios/safari * Disable autoplay on first load because we have weird issues (player starts to play and stop so we loose the big play button). We also don't want to autoplay muted videos (bad UX IMHO and we don't have ads to display) * Enable autoplay when we already played a video (fixes the issue with playlists) --- client/src/assets/player/webtorrent/webtorrent-plugin.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'client/src/assets/player/webtorrent/webtorrent-plugin.ts') diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts index 5c8aca1f8..782c91cbd 100644 --- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts +++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts @@ -74,7 +74,7 @@ class WebTorrentPlugin extends Plugin { this.startTime = timeToInt(options.startTime) // Disable auto play on iOS - this.autoplay = options.autoplay && isIOS() === false + this.autoplay = options.autoplay this.playerRefusedP2P = !getStoredP2PEnabled() this.videoFiles = options.videoFiles @@ -329,11 +329,6 @@ class WebTorrentPlugin extends Plugin { private tryToPlay (done?: (err?: Error) => void) { if (!done) done = function () { /* empty */ } - // Try in mute mode because we have issues with Safari - if (isSafari() && this.player.muted() === false) { - this.player.muted(true) - } - const playPromise = this.player.play() if (playPromise !== undefined) { return playPromise.then(() => done()) -- cgit v1.2.3