X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fshared%2Fvideo%2Fvideo-details.model.ts;h=14347a109da8478747c0127e5c18262a616795ff;hb=2ad9dcda240ee843c5e4a5b98cc94f7b2aab2c89;hp=8463e15d750491e3f5afe997acceb0c29232d5da;hpb=3a0fb65c61f80b510bce979a45d59d17948745e8;p=oweals%2Fpeertube.git diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index 8463e15d7..14347a109 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts @@ -1,5 +1,4 @@ -import { UserRight, VideoConstant, VideoDetails as VideoDetailsServerModel, VideoFile, VideoState } from '../../../../../shared' -import { AuthUser } from '../../core' +import { VideoConstant, VideoDetails as VideoDetailsServerModel, VideoFile, VideoState } from '../../../../../shared' import { Video } from '../../shared/video/video.model' import { Account } from '@app/shared/account/account.model' import { VideoChannel } from '@app/shared/video-channel/video-channel.model' @@ -52,4 +51,14 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { getHlsPlaylist () { return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) } + + hasHlsPlaylist () { + return !!this.getHlsPlaylist() + } + + getFiles () { + if (this.files.length === 0) return this.getHlsPlaylist().files + + return this.files + } }