diff options
Diffstat (limited to 'client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts')
-rw-r--r-- | client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts index 43fce475d..5e3946bf5 100644 --- a/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts +++ b/client/src/app/+video-channels/video-channel-videos/video-channel-videos.component.ts | |||
@@ -1,16 +1,16 @@ | |||
1 | import { Subscription } from 'rxjs' | 1 | import { Subscription } from 'rxjs' |
2 | import { first } from 'rxjs/operators' | 2 | import { first } from 'rxjs/operators' |
3 | import { Component, OnDestroy, OnInit } from '@angular/core' | 3 | import { AfterViewInit, Component, OnDestroy, OnInit } from '@angular/core' |
4 | import { ComponentPaginationLight, DisableForReuseHook, ScreenService } from '@app/core' | 4 | import { ComponentPaginationLight, DisableForReuseHook, HooksService, ScreenService } from '@app/core' |
5 | import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' | 5 | import { VideoChannel, VideoChannelService, VideoService } from '@app/shared/shared-main' |
6 | import { MiniatureDisplayOptions, VideoFilters } from '@app/shared/shared-video-miniature' | 6 | import { MiniatureDisplayOptions, VideoFilters } from '@app/shared/shared-video-miniature' |
7 | import { VideoSortField } from '@shared/models/videos' | 7 | import { Video, VideoSortField } from '@shared/models' |
8 | 8 | ||
9 | @Component({ | 9 | @Component({ |
10 | selector: 'my-video-channel-videos', | 10 | selector: 'my-video-channel-videos', |
11 | templateUrl: './video-channel-videos.component.html' | 11 | templateUrl: './video-channel-videos.component.html' |
12 | }) | 12 | }) |
13 | export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableForReuseHook { | 13 | export class VideoChannelVideosComponent implements OnInit, AfterViewInit, OnDestroy, DisableForReuseHook { |
14 | getVideosObservableFunction = this.getVideosObservable.bind(this) | 14 | getVideosObservableFunction = this.getVideosObservable.bind(this) |
15 | getSyndicationItemsFunction = this.getSyndicationItems.bind(this) | 15 | getSyndicationItemsFunction = this.getSyndicationItems.bind(this) |
16 | 16 | ||
@@ -36,7 +36,8 @@ export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableFo | |||
36 | constructor ( | 36 | constructor ( |
37 | private screenService: ScreenService, | 37 | private screenService: ScreenService, |
38 | private videoChannelService: VideoChannelService, | 38 | private videoChannelService: VideoChannelService, |
39 | private videoService: VideoService | 39 | private videoService: VideoService, |
40 | private hooks: HooksService | ||
40 | ) { | 41 | ) { |
41 | } | 42 | } |
42 | 43 | ||
@@ -45,9 +46,15 @@ export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableFo | |||
45 | this.videoChannelService.videoChannelLoaded.pipe(first()) | 46 | this.videoChannelService.videoChannelLoaded.pipe(first()) |
46 | .subscribe(videoChannel => { | 47 | .subscribe(videoChannel => { |
47 | this.videoChannel = videoChannel | 48 | this.videoChannel = videoChannel |
49 | |||
50 | this.hooks.runAction('action:video-channel-videos.video-channel.loaded', 'video-channel', { videoChannel }) | ||
48 | }) | 51 | }) |
49 | } | 52 | } |
50 | 53 | ||
54 | ngAfterViewInit () { | ||
55 | this.hooks.runAction('action:video-channel-videos.init', 'video-channel') | ||
56 | } | ||
57 | |||
51 | ngOnDestroy () { | 58 | ngOnDestroy () { |
52 | if (this.videoChannelSub) this.videoChannelSub.unsubscribe() | 59 | if (this.videoChannelSub) this.videoChannelSub.unsubscribe() |
53 | } | 60 | } |
@@ -79,4 +86,8 @@ export class VideoChannelVideosComponent implements OnInit, OnDestroy, DisableFo | |||
79 | enabledForReuse () { | 86 | enabledForReuse () { |
80 | this.disabled = false | 87 | this.disabled = false |
81 | } | 88 | } |
89 | |||
90 | onVideosLoaded (videos: Video[]) { | ||
91 | this.hooks.runAction('action:video-channel-videos.videos.loaded', 'video-channel', { videos }) | ||
92 | } | ||
82 | } | 93 | } |