From 092092969633bbcf6d4891a083ea497a7d5c3154 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 29 Jan 2019 08:37:25 +0100 Subject: Add hls support on server --- client/src/app/shared/video/video-details.model.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'client/src/app/shared/video/video-details.model.ts') diff --git a/client/src/app/shared/video/video-details.model.ts b/client/src/app/shared/video/video-details.model.ts index fa4ca7f93..f44b4138b 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' 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' +import { VideoStreamingPlaylist } from '../../../../../shared/models/videos/video-streaming-playlist.model' +import { VideoStreamingPlaylistType } from '../../../../../shared/models/videos/video-streaming-playlist.type' export class VideoDetails extends Video implements VideoDetailsServerModel { descriptionPath: string @@ -19,6 +21,10 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { likesPercent: number dislikesPercent: number + trackerUrls: string[] + + streamingPlaylists: VideoStreamingPlaylist[] + constructor (hash: VideoDetailsServerModel, translations = {}) { super(hash, translations) @@ -30,6 +36,9 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { this.support = hash.support this.commentsEnabled = hash.commentsEnabled + this.trackerUrls = hash.trackerUrls + this.streamingPlaylists = hash.streamingPlaylists + this.buildLikeAndDislikePercents() } @@ -53,4 +62,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 } + + getHlsPlaylist () { + return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) + } } -- cgit v1.2.3