UserRight,
Video as VideoServerModel,
VideoConstant,
+ VideoFile,
VideoPrivacy,
VideoScheduleUpdate,
- VideoState
+ VideoState,
+ VideoStreamingPlaylist
} from '@shared/models'
export class Video implements VideoServerModel {
embedPath: string
embedUrl: string
- url?: string
+ url: string
views: number
likes: number
waitTranscoding?: boolean
state?: VideoConstant<VideoState>
scheduledUpdate?: VideoScheduleUpdate
+
blacklisted?: boolean
- blockedReason?: string
+ blacklistedReason?: string
+
+ blockedOwner?: boolean
+ blockedServer?: boolean
account: {
id: number
pluginData?: any
+ streamingPlaylists?: VideoStreamingPlaylist[]
+ files?: VideoFile[]
+
static buildWatchUrl (video: Partial<Pick<Video, 'uuid' | 'shortUUID'>>) {
return buildVideoWatchPath({ shortUUID: video.shortUUID || video.uuid })
}
return '/videos/update/' + video.uuid
}
- constructor (hash: VideoServerModel, translations = {}) {
+ constructor (hash: VideoServerModel, translations: { [ id: string ]: string } = {}) {
const absoluteAPIUrl = getAbsoluteAPIUrl()
this.createdAt = new Date(hash.createdAt.toString())
if (this.state) this.state.label = peertubeTranslate(this.state.label, translations)
this.blacklisted = hash.blacklisted
- this.blockedReason = hash.blacklistedReason
+ this.blacklistedReason = hash.blacklistedReason
+
+ this.blockedOwner = hash.blockedOwner
+ this.blockedServer = hash.blockedServer
+
+ this.streamingPlaylists = hash.streamingPlaylists
+ this.files = hash.files
this.userHistory = hash.userHistory