aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/shared/metadata/video-attributes.component.ts
diff options
context:
space:
mode:
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.ts32
1 files changed, 30 insertions, 2 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
index b8f564c4c..ebfb42711 100644
--- 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
@@ -1,14 +1,35 @@
1import { Component, Input } from '@angular/core' 1import { Component, Input, OnInit } from '@angular/core'
2import { HooksService } from '@app/core'
2import { VideoDetails } from '@app/shared/shared-main' 3import { VideoDetails } from '@app/shared/shared-main'
3 4
5type PluginMetadata = {
6 label: string
7
8 value?: string
9 safeHTML?: string
10}
11
4@Component({ 12@Component({
5 selector: 'my-video-attributes', 13 selector: 'my-video-attributes',
6 templateUrl: './video-attributes.component.html', 14 templateUrl: './video-attributes.component.html',
7 styleUrls: [ './video-attributes.component.scss' ] 15 styleUrls: [ './video-attributes.component.scss' ]
8}) 16})
9export class VideoAttributesComponent { 17export class VideoAttributesComponent implements OnInit {
10 @Input() video: VideoDetails 18 @Input() video: VideoDetails
11 19
20 pluginMetadata: PluginMetadata[] = []
21
22 constructor (private hooks: HooksService) { }
23
24 async ngOnInit () {
25 this.pluginMetadata = await this.hooks.wrapFunResult(
26 this.buildPluginMetadata.bind(this),
27 { video: this.video },
28 'video-watch',
29 'filter:video-watch.video-plugin-metadata.result'
30 )
31 }
32
12 getVideoHost () { 33 getVideoHost () {
13 return this.video.channel.host 34 return this.video.channel.host
14 } 35 }
@@ -18,4 +39,11 @@ export class VideoAttributesComponent {
18 39
19 return this.video.tags 40 return this.video.tags
20 } 41 }
42
43 // Used for plugin hooks
44 private buildPluginMetadata (_options: {
45 video: VideoDetails
46 }): PluginMetadata[] {
47 return []
48 }
21} 49}