aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/shared
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-07-13 13:37:10 +0200
committerChocobozzz <me@florianbigard.com>2023-07-17 11:31:46 +0200
commit28dd2f14f5bdfd4781e489c42db6eaa7d40d560b (patch)
treec46a1b3f1df55e1ab80eab9e651784ddb91bde9c /client/src/assets/player/shared
parent930e1b939a8f4bdc6586eb5bc1fc531e6c13bfcd (diff)
downloadPeerTube-28dd2f14f5bdfd4781e489c42db6eaa7d40d560b.tar.gz
PeerTube-28dd2f14f5bdfd4781e489c42db6eaa7d40d560b.tar.zst
PeerTube-28dd2f14f5bdfd4781e489c42db6eaa7d40d560b.zip
Some player fixes on Android, Safari and iOS
Diffstat (limited to 'client/src/assets/player/shared')
-rw-r--r--client/src/assets/player/shared/peertube/peertube-plugin.ts8
-rw-r--r--client/src/assets/player/shared/web-video/web-video-plugin.ts3
2 files changed, 8 insertions, 3 deletions
diff --git a/client/src/assets/player/shared/peertube/peertube-plugin.ts b/client/src/assets/player/shared/peertube/peertube-plugin.ts
index f52ec75f4..7e5a3ebb6 100644
--- a/client/src/assets/player/shared/peertube/peertube-plugin.ts
+++ b/client/src/assets/player/shared/peertube/peertube-plugin.ts
@@ -1,7 +1,7 @@
1import debug from 'debug' 1import debug from 'debug'
2import videojs from 'video.js' 2import videojs from 'video.js'
3import { logger } from '@root-helpers/logger' 3import { logger } from '@root-helpers/logger'
4import { isIOS, isMobile } from '@root-helpers/web-browser' 4import { isIOS, isMobile, isSafari } from '@root-helpers/web-browser'
5import { timeToInt } from '@shared/core-utils' 5import { timeToInt } from '@shared/core-utils'
6import { VideoView, VideoViewEvent } from '@shared/models/videos' 6import { VideoView, VideoViewEvent } from '@shared/models/videos'
7import { 7import {
@@ -63,8 +63,10 @@ class PeerTubePlugin extends Plugin {
63 63
64 this.player.removeClass('vjs-has-autoplay') 64 this.player.removeClass('vjs-has-autoplay')
65 65
66 // Fix a bug on iOS where the big play button is not displayed when autoplay fails 66 this.player.poster(options.poster())
67 if (isIOS()) this.player.hasStarted(false) 67
68 // Fix a bug on iOS/Safari where the big play button is not displayed when autoplay fails
69 if (isIOS() || isSafari()) this.player.hasStarted(false)
68 }) 70 })
69 71
70 this.player.on('ratechange', () => { 72 this.player.on('ratechange', () => {
diff --git a/client/src/assets/player/shared/web-video/web-video-plugin.ts b/client/src/assets/player/shared/web-video/web-video-plugin.ts
index 80e56795b..930b5045a 100644
--- a/client/src/assets/player/shared/web-video/web-video-plugin.ts
+++ b/client/src/assets/player/shared/web-video/web-video-plugin.ts
@@ -77,6 +77,9 @@ class WebVideoPlugin extends Plugin {
77 77
78 const oldAutoplayValue = this.player.autoplay() 78 const oldAutoplayValue = this.player.autoplay()
79 if (options.isUserResolutionChange) { 79 if (options.isUserResolutionChange) {
80 // Prevent video source element displaying the poster when we change the resolution
81 (this.player.el() as HTMLVideoElement).poster = ''
82
80 this.player.autoplay(false) 83 this.player.autoplay(false)
81 this.player.addClass('vjs-updating-resolution') 84 this.player.addClass('vjs-updating-resolution')
82 } 85 }