diff options
author | Chocobozzz <me@florianbigard.com> | 2020-05-12 10:32:56 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-05-12 10:32:56 +0200 |
commit | 3e2bc4ea4955ee452d742647683b9021d6b4d6d5 (patch) | |
tree | a18736a735cbbf4da2244e713c223d7def8a015c /client/src/assets/player/utils.ts | |
parent | 1d05f9bbea70af55ba23679d2db177aefb21f2e7 (diff) | |
download | PeerTube-3e2bc4ea4955ee452d742647683b9021d6b4d6d5.tar.gz PeerTube-3e2bc4ea4955ee452d742647683b9021d6b4d6d5.tar.zst PeerTube-3e2bc4ea4955ee452d742647683b9021d6b4d6d5.zip |
Fix webtorrent play on Safari
Diffstat (limited to 'client/src/assets/player/utils.ts')
-rw-r--r-- | client/src/assets/player/utils.ts | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/client/src/assets/player/utils.ts b/client/src/assets/player/utils.ts index fa902e1f1..a72bf0123 100644 --- a/client/src/assets/player/utils.ts +++ b/client/src/assets/player/utils.ts | |||
@@ -8,6 +8,14 @@ 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 isIOS () { | ||
12 | return !!navigator.platform && /iPad|iPhone|iPod/.test(navigator.platform) | ||
13 | } | ||
14 | |||
15 | function isSafari () { | ||
16 | return /^((?!chrome|android).)*safari/i.test(navigator.userAgent) | ||
17 | } | ||
18 | |||
11 | // https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts | 19 | // https://github.com/danrevah/ngx-pipes/blob/master/src/pipes/math/bytes.ts |
12 | // Don't import all Angular stuff, just copy the code with shame | 20 | // Don't import all Angular stuff, just copy the code with shame |
13 | const dictionaryBytes: Array<{max: number, type: string}> = [ | 21 | const dictionaryBytes: Array<{max: number, type: string}> = [ |
@@ -192,5 +200,7 @@ export { | |||
192 | videoFileMinByResolution, | 200 | videoFileMinByResolution, |
193 | copyToClipboard, | 201 | copyToClipboard, |
194 | isMobile, | 202 | isMobile, |
195 | bytes | 203 | bytes, |
204 | isIOS, | ||
205 | isSafari | ||
196 | } | 206 | } |