]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - shared/models/videos/video.model.ts
Playlist server API
[github/Chocobozzz/PeerTube.git] / shared / models / videos / video.model.ts
1 import { AccountSummary, VideoChannelSummary, VideoResolution, VideoState } from '../../index'
2 import { Account } from '../actors'
3 import { Avatar } from '../avatars/avatar.model'
4 import { VideoChannel } from './channel/video-channel.model'
5 import { VideoPrivacy } from './video-privacy.enum'
6 import { VideoScheduleUpdate } from './video-schedule-update.model'
7 import { VideoConstant } from './video-constant.model'
8 import { VideoStreamingPlaylist } from './video-streaming-playlist.model'
9
10 export interface VideoFile {
11 magnetUri: string
12 resolution: VideoConstant<VideoResolution>
13 size: number // Bytes
14 torrentUrl: string
15 torrentDownloadUrl: string
16 fileUrl: string
17 fileDownloadUrl: string
18 fps: number
19 }
20
21 export interface Video {
22 id: number
23 uuid: string
24 createdAt: Date | string
25 updatedAt: Date | string
26 publishedAt: Date | string
27 originallyPublishedAt: Date | string
28 category: VideoConstant<number>
29 licence: VideoConstant<number>
30 language: VideoConstant<string>
31 privacy: VideoConstant<VideoPrivacy>
32 description: string
33 duration: number
34 isLocal: boolean
35 name: string
36 thumbnailPath: string
37 previewPath: string
38 embedPath: string
39 views: number
40 likes: number
41 dislikes: number
42 nsfw: boolean
43
44 waitTranscoding?: boolean
45 state?: VideoConstant<VideoState>
46 scheduledUpdate?: VideoScheduleUpdate
47
48 blacklisted?: boolean
49 blacklistedReason?: string
50
51 account: AccountSummary
52 channel: VideoChannelSummary
53
54 userHistory?: {
55 currentTime: number
56 }
57
58 playlistElement?: {
59 position: number
60 startTimestamp: number
61 stopTimestamp: number
62 }
63 }
64
65 export interface VideoDetails extends Video {
66 descriptionPath: string
67 support: string
68 channel: VideoChannel
69 tags: string[]
70 files: VideoFile[]
71 account: Account
72 commentsEnabled: boolean
73 downloadEnabled: boolean
74
75 // Not optional in details (unlike in Video)
76 waitTranscoding: boolean
77 state: VideoConstant<VideoState>
78
79 trackerUrls: string[]
80
81 streamingPlaylists: VideoStreamingPlaylist[]
82 }