X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Froot-helpers%2Fvideo.ts;h=107ba1eba704658bccf2fcefccf7e8911820f891;hb=8ca52bcc2c37d457e8b19a237c66b8dd1c00b6b9;hp=ba84e49ea2cd862081414f5be233df691a25a99b;hpb=de61544582726713c965d3369902f4a464f72e20;p=github%2FChocobozzz%2FPeerTube.git 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 @@ -import { HTMLServerConfig, Video } from '@shared/models' +import { HTMLServerConfig, Video, VideoPrivacy } from '@shared/models' function buildVideoOrPlaylistEmbed (options: { embedUrl: string @@ -26,9 +26,14 @@ function isP2PEnabled (video: Video, config: HTMLServerConfig, userP2PEnabled: b return userP2PEnabled } +function videoRequiresAuth (video: Video) { + return new Set([ VideoPrivacy.PRIVATE, VideoPrivacy.INTERNAL ]).has(video.privacy.id) +} + export { buildVideoOrPlaylistEmbed, - isP2PEnabled + isP2PEnabled, + videoRequiresAuth } // ---------------------------------------------------------------------------