aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/shared/shared-video-playlist/video-playlist-element.model.ts
blob: f25f10ede5dd818cd0a344881477af29944cd7db (plain) (tree)
1
2
                                               
                                                                                                             





















                                                                         
import { Video } from '@app/shared/shared-main'
import { VideoPlaylistElement as ServerVideoPlaylistElement, VideoPlaylistElementType } from '@shared/models'

export class VideoPlaylistElement implements ServerVideoPlaylistElement {
  id: number
  position: number
  startTimestamp: number
  stopTimestamp: number

  type: VideoPlaylistElementType

  video?: Video

  constructor (hash: ServerVideoPlaylistElement, translations: {}) {
    this.id = hash.id
    this.position = hash.position
    this.startTimestamp = hash.startTimestamp
    this.stopTimestamp = hash.stopTimestamp

    this.type = hash.type

    if (hash.video) this.video = new Video(hash.video, translations)
  }
}