diff options
Diffstat (limited to 'client/src')
-rw-r--r-- | client/src/assets/player/peertube-player-manager.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/src/assets/player/peertube-player-manager.ts b/client/src/assets/player/peertube-player-manager.ts index 12e460f03..61da6a4cb 100644 --- a/client/src/assets/player/peertube-player-manager.ts +++ b/client/src/assets/player/peertube-player-manager.ts | |||
@@ -233,7 +233,7 @@ export class PeertubePlayerManager { | |||
233 | : undefined, // Undefined so the player knows it has to check the local storage | 233 | : undefined, // Undefined so the player knows it has to check the local storage |
234 | 234 | ||
235 | autoplay: autoplay === true | 235 | autoplay: autoplay === true |
236 | ? 'play' // Use 'any' instead of true to get notifier by videojs if autoplay fails | 236 | ? this.getAutoPlayValue() |
237 | : autoplay, | 237 | : autoplay, |
238 | 238 | ||
239 | poster: commonOptions.poster, | 239 | poster: commonOptions.poster, |
@@ -509,6 +509,16 @@ export class PeertubePlayerManager { | |||
509 | } | 509 | } |
510 | }) | 510 | }) |
511 | } | 511 | } |
512 | |||
513 | private static getAutoPlayValue () { | ||
514 | const isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent) | ||
515 | |||
516 | // We have issues with autoplay and Safari. | ||
517 | // any that tries to play using auto mute seems to work | ||
518 | if (isSafari) return 'any' | ||
519 | |||
520 | return 'play' | ||
521 | } | ||
512 | } | 522 | } |
513 | 523 | ||
514 | // ############################################################################ | 524 | // ############################################################################ |