aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/typings/models/video/video-streaming-playlist.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-11-15 15:06:03 +0100
committerChocobozzz <me@florianbigard.com>2019-11-25 10:59:43 +0100
commitd7a25329f9e607894d29ab342b9cb66638b56dc0 (patch)
tree6cd6bc4f2689f78944238b313c93427423a932ac /server/typings/models/video/video-streaming-playlist.ts
parent14981d7331da3f63fe6cfaf020ccb7c910006eaf (diff)
downloadPeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.gz
PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.tar.zst
PeerTube-d7a25329f9e607894d29ab342b9cb66638b56dc0.zip
Add ability to disable webtorrent
In favour of HLS
Diffstat (limited to 'server/typings/models/video/video-streaming-playlist.ts')
-rw-r--r--server/typings/models/video/video-streaming-playlist.ts18
1 files changed, 16 insertions, 2 deletions
diff --git a/server/typings/models/video/video-streaming-playlist.ts b/server/typings/models/video/video-streaming-playlist.ts
index 79696bcff..436c0c072 100644
--- a/server/typings/models/video/video-streaming-playlist.ts
+++ b/server/typings/models/video/video-streaming-playlist.ts
@@ -1,19 +1,33 @@
1import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist' 1import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist'
2import { PickWith, PickWithOpt } from '../../utils' 2import { PickWith, PickWithOpt } from '../../utils'
3import { MVideoRedundancyFileUrl } from './video-redundancy' 3import { MVideoRedundancyFileUrl } from './video-redundancy'
4import { MVideo, MVideoUrl } from '@server/typings/models' 4import { MVideo } from './video'
5import { MVideoFile } from './video-file'
5 6
6type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M> 7type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M>
7 8
8// ############################################################################ 9// ############################################################################
9 10
10export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos'> 11export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'>
12
13export type MStreamingPlaylistFiles = MStreamingPlaylist &
14 Use<'VideoFiles', MVideoFile[]>
11 15
12export type MStreamingPlaylistVideo = MStreamingPlaylist & 16export type MStreamingPlaylistVideo = MStreamingPlaylist &
13 Use<'Video', MVideo> 17 Use<'Video', MVideo>
14 18
19export type MStreamingPlaylistFilesVideo = MStreamingPlaylist &
20 Use<'VideoFiles', MVideoFile[]> &
21 Use<'Video', MVideo>
22
15export type MStreamingPlaylistRedundancies = MStreamingPlaylist & 23export type MStreamingPlaylistRedundancies = MStreamingPlaylist &
24 Use<'VideoFiles', MVideoFile[]> &
16 Use<'RedundancyVideos', MVideoRedundancyFileUrl[]> 25 Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>
17 26
18export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist & 27export type MStreamingPlaylistRedundanciesOpt = MStreamingPlaylist &
28 Use<'VideoFiles', MVideoFile[]> &
19 PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]> 29 PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>
30
31export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo {
32 return !!(value as MStreamingPlaylist).playlistUrl
33}