diff options
Diffstat (limited to 'client/src/app/videos/video-watch/video-watch.component.ts')
-rw-r--r-- | client/src/app/videos/video-watch/video-watch.component.ts | 15 |
1 files changed, 14 insertions, 1 deletions
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 256ffef99..d83cc5a7a 100644 --- a/client/src/app/videos/video-watch/video-watch.component.ts +++ b/client/src/app/videos/video-watch/video-watch.component.ts | |||
@@ -5,8 +5,10 @@ import { ActivatedRoute } from '@angular/router'; | |||
5 | import { MetaService } from 'ng2-meta'; | 5 | import { MetaService } from 'ng2-meta'; |
6 | import * as videojs from 'video.js'; | 6 | import * as videojs from 'video.js'; |
7 | 7 | ||
8 | import { AuthService } from '../../core'; | ||
8 | import { VideoMagnetComponent } from './video-magnet.component'; | 9 | import { VideoMagnetComponent } from './video-magnet.component'; |
9 | import { VideoShareComponent } from './video-share.component'; | 10 | import { VideoShareComponent } from './video-share.component'; |
11 | import { VideoReportComponent } from './video-report.component'; | ||
10 | import { Video, VideoService } from '../shared'; | 12 | import { Video, VideoService } from '../shared'; |
11 | import { WebTorrentService } from './webtorrent.service'; | 13 | import { WebTorrentService } from './webtorrent.service'; |
12 | 14 | ||
@@ -21,6 +23,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
21 | 23 | ||
22 | @ViewChild('videoMagnetModal') videoMagnetModal: VideoMagnetComponent; | 24 | @ViewChild('videoMagnetModal') videoMagnetModal: VideoMagnetComponent; |
23 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent; | 25 | @ViewChild('videoShareModal') videoShareModal: VideoShareComponent; |
26 | @ViewChild('videoReportModal') videoReportModal: VideoReportComponent; | ||
24 | 27 | ||
25 | downloadSpeed: number; | 28 | downloadSpeed: number; |
26 | error: boolean = false; | 29 | error: boolean = false; |
@@ -42,7 +45,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
42 | private route: ActivatedRoute, | 45 | private route: ActivatedRoute, |
43 | private videoService: VideoService, | 46 | private videoService: VideoService, |
44 | private metaService: MetaService, | 47 | private metaService: MetaService, |
45 | private webTorrentService: WebTorrentService | 48 | private webTorrentService: WebTorrentService, |
49 | private authService: AuthService | ||
46 | ) {} | 50 | ) {} |
47 | 51 | ||
48 | ngOnInit() { | 52 | ngOnInit() { |
@@ -123,6 +127,11 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
123 | }); | 127 | }); |
124 | } | 128 | } |
125 | 129 | ||
130 | showReportModal(event: Event) { | ||
131 | event.preventDefault(); | ||
132 | this.videoReportModal.show(); | ||
133 | } | ||
134 | |||
126 | showShareModal() { | 135 | showShareModal() { |
127 | this.videoShareModal.show(); | 136 | this.videoShareModal.show(); |
128 | } | 137 | } |
@@ -131,6 +140,10 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
131 | this.videoMagnetModal.show(); | 140 | this.videoMagnetModal.show(); |
132 | } | 141 | } |
133 | 142 | ||
143 | isUserLoggedIn() { | ||
144 | return this.authService.isLoggedIn(); | ||
145 | } | ||
146 | |||
134 | private loadTooLong() { | 147 | private loadTooLong() { |
135 | this.error = true; | 148 | this.error = true; |
136 | console.error('The video load seems to be abnormally long.'); | 149 | console.error('The video load seems to be abnormally long.'); |