2019-08-15 11:53:26 +02:00
|
|
|
import { VideoStreamingPlaylistModel } from '../../../models/video/video-streaming-playlist'
|
2019-08-21 14:31:57 +02:00
|
|
|
import { PickWith, PickWithOpt } from '../../utils'
|
2020-01-10 10:11:28 +01:00
|
|
|
import { MVideoRedundancyFileUrl, MVideoRedundancy } from './video-redundancy'
|
2019-11-15 15:06:03 +01:00
|
|
|
import { MVideo } from './video'
|
|
|
|
import { MVideoFile } from './video-file'
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2019-08-20 13:52:49 +02:00
|
|
|
type Use<K extends keyof VideoStreamingPlaylistModel, M> = PickWith<VideoStreamingPlaylistModel, K, M>
|
|
|
|
|
|
|
|
// ############################################################################
|
|
|
|
|
2019-11-15 15:06:03 +01:00
|
|
|
export type MStreamingPlaylist = Omit<VideoStreamingPlaylistModel, 'Video' | 'RedundancyVideos' | 'VideoFiles'>
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MStreamingPlaylistFiles =
|
|
|
|
MStreamingPlaylist &
|
2019-11-15 15:06:03 +01:00
|
|
|
Use<'VideoFiles', MVideoFile[]>
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MStreamingPlaylistVideo =
|
|
|
|
MStreamingPlaylist &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'Video', MVideo>
|
2019-08-15 11:53:26 +02:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MStreamingPlaylistFilesVideo =
|
|
|
|
MStreamingPlaylist &
|
2019-11-15 15:06:03 +01:00
|
|
|
Use<'VideoFiles', MVideoFile[]> &
|
|
|
|
Use<'Video', MVideo>
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MStreamingPlaylistRedundanciesAll =
|
|
|
|
MStreamingPlaylist &
|
2020-01-10 10:11:28 +01:00
|
|
|
Use<'VideoFiles', MVideoFile[]> &
|
|
|
|
Use<'RedundancyVideos', MVideoRedundancy[]>
|
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MStreamingPlaylistRedundancies =
|
|
|
|
MStreamingPlaylist &
|
2019-11-15 15:06:03 +01:00
|
|
|
Use<'VideoFiles', MVideoFile[]> &
|
2019-08-20 13:52:49 +02:00
|
|
|
Use<'RedundancyVideos', MVideoRedundancyFileUrl[]>
|
2019-08-21 14:31:57 +02:00
|
|
|
|
2020-01-31 16:56:52 +01:00
|
|
|
export type MStreamingPlaylistRedundanciesOpt =
|
|
|
|
MStreamingPlaylist &
|
2019-11-15 15:06:03 +01:00
|
|
|
Use<'VideoFiles', MVideoFile[]> &
|
2019-08-21 14:31:57 +02:00
|
|
|
PickWithOpt<VideoStreamingPlaylistModel, 'RedundancyVideos', MVideoRedundancyFileUrl[]>
|
2019-11-15 15:06:03 +01:00
|
|
|
|
|
|
|
export function isStreamingPlaylist (value: MVideo | MStreamingPlaylistVideo): value is MStreamingPlaylistVideo {
|
|
|
|
return !!(value as MStreamingPlaylist).playlistUrl
|
|
|
|
}
|