support: string
channel: VideoChannel
tags: string[]
- files: VideoFile[]
account: Account
commentsEnabled: boolean
downloadEnabled: boolean
trackerUrls: string[]
+ files: VideoFile[]
streamingPlaylists: VideoStreamingPlaylist[]
constructor (hash: VideoDetailsServerModel, translations = {}) {
super(hash, translations)
this.descriptionPath = hash.descriptionPath
- this.files = hash.files
this.channel = new VideoChannel(hash.channel)
this.account = new Account(hash.account)
this.tags = hash.tags
this.downloadEnabled = hash.downloadEnabled
this.trackerUrls = hash.trackerUrls
- this.streamingPlaylists = hash.streamingPlaylists
this.buildLikeAndDislikePercents()
}
}
getFiles () {
- if (this.files.length === 0) return this.getHlsPlaylist().files
+ if (this.files.length !== 0) return this.files
+
+ const hls = this.getHlsPlaylist()
+ if (hls) return hls.files
- return this.files
+ return []
}
}