aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/assets/player/utils.ts')
-rw-r--r--client/src/assets/player/utils.ts10
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 @@
1import { VideoFile } from '@shared/models' 1import { HTMLServerConfig, Video, VideoFile } from '@shared/models'
2 2
3function toTitleCase (str: string) { 3function 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
11function 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
11function isIOS () { 18function 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,