video.model.ts 2.0 KB

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