diff options
Diffstat (limited to 'client/src/root-helpers/video.ts')
-rw-r--r-- | client/src/root-helpers/video.ts | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/client/src/root-helpers/video.ts b/client/src/root-helpers/video.ts index ba84e49ea..107ba1eba 100644 --- a/client/src/root-helpers/video.ts +++ b/client/src/root-helpers/video.ts | |||
@@ -1,4 +1,4 @@ | |||
1 | import { HTMLServerConfig, Video } from '@shared/models' | 1 | import { HTMLServerConfig, Video, VideoPrivacy } from '@shared/models' |
2 | 2 | ||
3 | function buildVideoOrPlaylistEmbed (options: { | 3 | function buildVideoOrPlaylistEmbed (options: { |
4 | embedUrl: string | 4 | embedUrl: string |
@@ -26,9 +26,14 @@ function isP2PEnabled (video: Video, config: HTMLServerConfig, userP2PEnabled: b | |||
26 | return userP2PEnabled | 26 | return userP2PEnabled |
27 | } | 27 | } |
28 | 28 | ||
29 | function videoRequiresAuth (video: Video) { | ||
30 | return new Set([ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL ]).has(video.privacy.id) | ||
31 | } | ||
32 | |||
29 | export { | 33 | export { |
30 | buildVideoOrPlaylistEmbed, | 34 | buildVideoOrPlaylistEmbed, |
31 | isP2PEnabled | 35 | isP2PEnabled, |
36 | videoRequiresAuth | ||
32 | } | 37 | } |
33 | 38 | ||
34 | // --------------------------------------------------------------------------- | 39 | // --------------------------------------------------------------------------- |