]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/video/video-details.model.ts
`fitWidth` for `video-miniature`, fluid grid (#2830)
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / video / video-details.model.ts
index 8463e15d750491e3f5afe997acceb0c29232d5da..14347a109da8478747c0127e5c18262a616795ff 100644 (file)
@@ -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
+  }
 }