Browse Source

Video-watch hooks modifications for videojs

Rigel Kent 2 weeks ago
parent
commit
5f85f8aa1c
No account linked to committer's email address

+ 4
- 1
client/src/app/videos/+video-watch/video-watch.component.ts View File

@@ -20,6 +20,7 @@ import { environment } from '../../../environments/environment'
20 20
 import { VideoCaptionService } from '@app/shared/video-caption'
21 21
 import { MarkdownService } from '@app/shared/renderer'
22 22
 import {
23
+  videojs,
23 24
   CustomizationOptions,
24 25
   P2PMediaLoaderOptions,
25 26
   PeertubePlayerManager,
@@ -500,6 +501,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
500 501
       this.player.on('theaterChange', (_: any, enabled: boolean) => {
501 502
         this.zone.run(() => this.theaterEnabled = enabled)
502 503
       })
504
+
505
+      this.hooks.runAction('action:video-watch.player.loaded', 'video-watch', { player: this.player })
503 506
     })
504 507
 
505 508
     this.setVideoDescriptionHTML()
@@ -508,7 +511,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
508 511
     this.setOpenGraphTags()
509 512
     this.checkUserRating()
510 513
 
511
-    this.hooks.runAction('action:video-watch.video.loaded', 'video-watch')
514
+    this.hooks.runAction('action:video-watch.video.loaded', 'video-watch', { videojs })
512 515
   }
513 516
 
514 517
   private autoplayNext () {

+ 2
- 0
shared/models/plugins/client-hook.model.ts View File

@@ -51,6 +51,8 @@ export const clientActionHookObject = {
51 51
   'action:video-watch.init': true,
52 52
   // Fired when the video watch page loaded the video
53 53
   'action:video-watch.video.loaded': true,
54
+  // Fired when the player finished loading
55
+  'action:video-watch.player.loaded': true,
54 56
 
55 57
   // Fired when the search page is being initialized
56 58
   'action:search.init': true,

Loading…
Cancel
Save