aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player')
-rw-r--r--client/src/assets/player/peertube-player-manager.ts16
1 files changed, 8 insertions, 8 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts
index 8e0a9109f..4d72523f7 100644
--- a/client/src/assets/player/peertube-player-manager.ts
+++ b/client/src/assets/player/peertube-player-manager.ts
@@ -365,8 +365,12 @@ export class PeertubePlayerManager {
365 const commonOptions = options.common 365 const commonOptions = options.common
366 const webtorrentOptions = options.webtorrent 366 const webtorrentOptions = options.webtorrent
367 367
368 const autoplay = this.getAutoPlayValue(commonOptions.autoplay) === 'play'
369 ? true
370 : false
371
368 const webtorrent = { 372 const webtorrent = {
369 autoplay: commonOptions.autoplay, 373 autoplay,
370 videoDuration: commonOptions.videoDuration, 374 videoDuration: commonOptions.videoDuration,
371 playerElement: commonOptions.playerElement, 375 playerElement: commonOptions.playerElement,
372 videoFiles: webtorrentOptions.videoFiles, 376 videoFiles: webtorrentOptions.videoFiles,
@@ -586,13 +590,9 @@ export class PeertubePlayerManager {
586 private static getAutoPlayValue (autoplay: any) { 590 private static getAutoPlayValue (autoplay: any) {
587 if (autoplay !== true) return autoplay 591 if (autoplay !== true) return autoplay
588 592
589 // We have issues with autoplay and Safari with webtorrent 593 // On first play, disable autoplay to avoid issues
590 if (isIOS()) { 594 // But if the player already played videos, we can safely autoplay next ones
591 // On first play, disable autoplay to avoid issues 595 if (isIOS() || isSafari()) {
592 // But if the player already played videos, we can safely autoplay next ones
593 return PeertubePlayerManager.alreadyPlayed ? 'play' : false
594 } else if (isSafari()) {
595 // Issues with Safari and webtorrent on first play
596 return PeertubePlayerManager.alreadyPlayed ? 'play' : false 596 return PeertubePlayerManager.alreadyPlayed ? 'play' : false
597 } 597 }
598 598