diff options
Diffstat (limited to 'client/src/assets/player/utils.ts')
-rw-r--r-- | client/src/assets/player/utils.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index 18380d950..7e25e3067 100644 --- a/client/src/assets/player/utils.ts +++ b/client/src/assets/player/utils.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { VideoFile } from '@shared/models' | 1 | import { HTMLServerConfig, Video, VideoFile } from '@shared/models' |
2 | 2 | ||
3 | function toTitleCase (str: string) { | 3 | function toTitleCase (str: string) { |
4 | return str.charAt(0).toUpperCase() + str.slice(1) | 4 | return str.charAt(0).toUpperCase() + str.slice(1) |
@@ -8,6 +8,13 @@ function isWebRTCDisabled () { | |||
8 | return !!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false | 8 | return !!((window as any).RTCPeerConnection || (window as any).mozRTCPeerConnection || (window as any).webkitRTCPeerConnection) === false |
9 | } | 9 | } |
10 | 10 | ||
11 | function isP2PEnabled (video: Video, config: HTMLServerConfig, userP2PEnabled: boolean) { | ||
12 | if (video.isLocal && config.tracker.enabled === false) return false | ||
13 | if (isWebRTCDisabled()) return false | ||
14 | |||
15 | return userP2PEnabled | ||
16 | } | ||
17 | |||
11 | function isIOS () { | 18 | function isIOS () { |
12 | if (/iPad|iPhone|iPod/.test(navigator.platform)) { | 19 | if (/iPad|iPhone|iPod/.test(navigator.platform)) { |
13 | return true | 20 | return true |
@@ -97,6 +104,7 @@ export { | |||
97 | getRtcConfig, | 104 | getRtcConfig, |
98 | toTitleCase, | 105 | toTitleCase, |
99 | isWebRTCDisabled, | 106 | isWebRTCDisabled, |
107 | isP2PEnabled, | ||
100 | 108 | ||
101 | buildVideoOrPlaylistEmbed, | 109 | buildVideoOrPlaylistEmbed, |
102 | videoFileMaxByResolution, | 110 | videoFileMaxByResolution, |