video.model.ts 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import { 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. 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 VideoChannelAttribute {
  19. id: number
  20. uuid: string
  21. name: string
  22. displayName: string
  23. url: string
  24. host: string
  25. avatar: Avatar
  26. }
  27. export interface AccountAttribute {
  28. id: number
  29. uuid: string
  30. name: string
  31. displayName: string
  32. url: string
  33. host: string
  34. avatar: Avatar
  35. }
  36. export interface Video {
  37. id: number
  38. uuid: string
  39. createdAt: Date | string
  40. updatedAt: Date | string
  41. publishedAt: Date | string
  42. category: VideoConstant<number>
  43. licence: VideoConstant<number>
  44. language: VideoConstant<string>
  45. privacy: VideoConstant<VideoPrivacy>
  46. description: string
  47. duration: number
  48. isLocal: boolean
  49. name: string
  50. thumbnailPath: string
  51. previewPath: string
  52. embedPath: string
  53. views: number
  54. likes: number
  55. dislikes: number
  56. nsfw: boolean
  57. waitTranscoding?: boolean
  58. state?: VideoConstant<VideoState>
  59. scheduledUpdate?: VideoScheduleUpdate
  60. blacklisted?: boolean
  61. blacklistedReason?: string
  62. account: AccountAttribute
  63. channel: VideoChannelAttribute
  64. userHistory?: {
  65. currentTime: number
  66. }
  67. }
  68. export interface VideoDetails extends Video {
  69. descriptionPath: string
  70. support: string
  71. channel: VideoChannel
  72. tags: string[]
  73. files: VideoFile[]
  74. account: Account
  75. commentsEnabled: boolean
  76. // Not optional in details (unlike in Video)
  77. waitTranscoding: boolean
  78. state: VideoConstant<VideoState>
  79. }