diff options
Diffstat (limited to 'client/src/app/shared/video/video-details.model.ts')
-rw-r--r-- | client/src/app/shared/video/video-details.model.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index 5ff3926c4..388357343 100644 --- a/client/src/app/shared/video/video-details.model.ts +++ b/client/src/app/shared/video/video-details.model.ts | |||
@@ -3,6 +3,8 @@ import { AuthUser } from '../../core' | |||
3 | import { Video } from '../../shared/video/video.model' | 3 | import { Video } from '../../shared/video/video.model' |
4 | import { Account } from '@app/shared/account/account.model' | 4 | import { Account } from '@app/shared/account/account.model' |
5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' | 5 | import { VideoChannel } from '@app/shared/video-channel/video-channel.model' |
6 | import { VideoStreamingPlaylist } from '../../../../../shared/models/videos/video-streaming-playlist.model' | ||
7 | import { VideoStreamingPlaylistType } from '../../../../../shared/models/videos/video-streaming-playlist.type' | ||
6 | 8 | ||
7 | export class VideoDetails extends Video implements VideoDetailsServerModel { | 9 | export class VideoDetails extends Video implements VideoDetailsServerModel { |
8 | descriptionPath: string | 10 | descriptionPath: string |
@@ -20,6 +22,10 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
20 | likesPercent: number | 22 | likesPercent: number |
21 | dislikesPercent: number | 23 | dislikesPercent: number |
22 | 24 | ||
25 | trackerUrls: string[] | ||
26 | |||
27 | streamingPlaylists: VideoStreamingPlaylist[] | ||
28 | |||
23 | constructor (hash: VideoDetailsServerModel, translations = {}) { | 29 | constructor (hash: VideoDetailsServerModel, translations = {}) { |
24 | super(hash, translations) | 30 | super(hash, translations) |
25 | 31 | ||
@@ -32,6 +38,9 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
32 | this.commentsEnabled = hash.commentsEnabled | 38 | this.commentsEnabled = hash.commentsEnabled |
33 | this.downloadEnabled = hash.downloadEnabled | 39 | this.downloadEnabled = hash.downloadEnabled |
34 | 40 | ||
41 | this.trackerUrls = hash.trackerUrls | ||
42 | this.streamingPlaylists = hash.streamingPlaylists | ||
43 | |||
35 | this.buildLikeAndDislikePercents() | 44 | this.buildLikeAndDislikePercents() |
36 | } | 45 | } |
37 | 46 | ||
@@ -55,4 +64,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
55 | this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 | 64 | this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 |
56 | this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 | 65 | this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 |
57 | } | 66 | } |
67 | |||
68 | getHlsPlaylist () { | ||
69 | return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) | ||
70 | } | ||
58 | } | 71 | } |