]>
Commit | Line | Data |
---|---|---|
1 | import { Component, Input } from '@angular/core' | |
2 | import { VideoDetails } from '@app/shared/shared-main' | |
3 | ||
4 | @Component({ | |
5 | selector: 'my-video-attributes', | |
6 | templateUrl: './video-attributes.component.html', | |
7 | styleUrls: [ './video-attributes.component.scss' ] | |
8 | }) | |
9 | export class VideoAttributesComponent { | |
10 | @Input() video: VideoDetails | |
11 | ||
12 | getVideoUrl () { | |
13 | if (!this.video.url) { | |
14 | return this.video.originInstanceUrl + VideoDetails.buildWatchUrl(this.video) | |
15 | } | |
16 | ||
17 | return this.video.url | |
18 | } | |
19 | ||
20 | getVideoTags () { | |
21 | if (!this.video || Array.isArray(this.video.tags) === false) return [] | |
22 | ||
23 | return this.video.tags | |
24 | } | |
25 | } |