diff options
author | Chocobozzz <me@florianbigard.com> | 2019-01-29 08:37:25 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-02-11 09:13:02 +0100 |
commit | 092092969633bbcf6d4891a083ea497a7d5c3154 (patch) | |
tree | 69e82fe4f60c444cca216830e96afe143a9dac71 /client/src/app/shared | |
parent | 4348a27d252a3349bafa7ef4859c0e2cf060c255 (diff) | |
download | PeerTube-092092969633bbcf6d4891a083ea497a7d5c3154.tar.gz PeerTube-092092969633bbcf6d4891a083ea497a7d5c3154.tar.zst PeerTube-092092969633bbcf6d4891a083ea497a7d5c3154.zip |
Add hls support on server
Diffstat (limited to 'client/src/app/shared')
-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 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' | |||
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 |
@@ -19,6 +21,10 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
19 | likesPercent: number | 21 | likesPercent: number |
20 | dislikesPercent: number | 22 | dislikesPercent: number |
21 | 23 | ||
24 | trackerUrls: string[] | ||
25 | |||
26 | streamingPlaylists: VideoStreamingPlaylist[] | ||
27 | |||
22 | constructor (hash: VideoDetailsServerModel, translations = {}) { | 28 | constructor (hash: VideoDetailsServerModel, translations = {}) { |
23 | super(hash, translations) | 29 | super(hash, translations) |
24 | 30 | ||
@@ -30,6 +36,9 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
30 | this.support = hash.support | 36 | this.support = hash.support |
31 | this.commentsEnabled = hash.commentsEnabled | 37 | this.commentsEnabled = hash.commentsEnabled |
32 | 38 | ||
39 | this.trackerUrls = hash.trackerUrls | ||
40 | this.streamingPlaylists = hash.streamingPlaylists | ||
41 | |||
33 | this.buildLikeAndDislikePercents() | 42 | this.buildLikeAndDislikePercents() |
34 | } | 43 | } |
35 | 44 | ||
@@ -53,4 +62,8 @@ export class VideoDetails extends Video implements VideoDetailsServerModel { | |||
53 | this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 | 62 | this.likesPercent = (this.likes / (this.likes + this.dislikes)) * 100 |
54 | this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 | 63 | this.dislikesPercent = (this.dislikes / (this.likes + this.dislikes)) * 100 |
55 | } | 64 | } |
65 | |||
66 | getHlsPlaylist () { | ||
67 | return this.streamingPlaylists.find(p => p.type === VideoStreamingPlaylistType.HLS) | ||
68 | } | ||
56 | } | 69 | } |