aboutsummaryrefslogblamecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
blob: 9429581ac7ce6ebbe386ae56763f26a5baa092a8 (plain) (tree)


















                                                                                  



                                  





                                                                          
import { Component, Input } from '@angular/core'
import { VideoDetails } from '@app/shared/shared-main'

@Component({
  selector: 'my-video-attributes',
  templateUrl: './video-attributes.component.html',
  styleUrls: [ './video-attributes.component.scss' ]
})
export class VideoAttributesComponent {
  @Input() video: VideoDetails

  getVideoUrl () {
    if (!this.video.url) {
      return this.video.originInstanceUrl + VideoDetails.buildWatchUrl(this.video)
    }

    return this.video.url
  }

  getVideoHost () {
    return this.video.channel.host
  }

  getVideoTags () {
    if (!this.video || Array.isArray(this.video.tags) === false) return []

    return this.video.tags
  }
}