aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-30 09:49:45 +0200
committerChocobozzz <me@florianbigard.com>2021-06-30 09:49:45 +0200
commitc894a1ea72fd1f16c9f1fc0dae14213b2937152d (patch)
treee99f5f064eecf82356637d92ec72b3debf1e9335 /client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
parent2453589a286e1f65843af582512387b2fa17b502 (diff)
downloadPeerTube-c894a1ea72fd1f16c9f1fc0dae14213b2937152d.tar.gz
PeerTube-c894a1ea72fd1f16c9f1fc0dae14213b2937152d.tar.zst
PeerTube-c894a1ea72fd1f16c9f1fc0dae14213b2937152d.zip
Move watch attributes in a dedicated component
Diffstat (limited to 'client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts')
-rw-r--r--client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts25
1 files changed, 25 insertions, 0 deletions
diff --git a/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
new file mode 100644
index 000000000..5cb77f0c8
--- /dev/null
+++ b/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
@@ -0,0 +1,25 @@
1import { Component, Input } from '@angular/core'
2import { 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})
9export 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}