From 18a6f04c071f7a0735eb39b8c67fd51a082d1a31 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 8 Jul 2019 15:54:08 +0200 Subject: WIP plugins: hook on client side --- client/src/app/videos/+video-watch/video-watch.component.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'client/src/app/videos') diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.ts index 3f1a98f89..6d8bb4b3f 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -32,6 +32,7 @@ import { Video } from '@app/shared/video/video.model' import { isWebRTCDisabled, timeToInt } from '../../../assets/player/utils' import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watch-playlist.component' import { getStoredTheater } from '../../../assets/player/peertube-player-local-storage' +import { PluginService } from '@app/core/plugins/plugin.service' @Component({ selector: 'my-video-watch', @@ -85,6 +86,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { private serverService: ServerService, private restExtractor: RestExtractor, private notifier: Notifier, + private pluginService: PluginService, private markdownService: MarkdownService, private zone: NgZone, private redirectService: RedirectService, @@ -98,7 +100,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy { return this.authService.getUser() } - ngOnInit () { + async ngOnInit () { + await this.pluginService.loadPluginsByScope('video-watch') + this.configSub = this.serverService.configLoaded .subscribe(() => { if ( @@ -126,6 +130,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { this.initHotkeys() this.theaterEnabled = getStoredTheater() + + this.pluginService.runHook('action:video-watch.loaded') } ngOnDestroy () { -- cgit v1.2.3