aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch/video-watch.component.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-01-20 19:22:15 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-01-20 19:22:15 +0100
commit4f8c0eb0e9356ee2782ea6eb12a92e4dc5f66127 (patch)
treebcef1232a565ceaf3d43415a0b08e53e30c236d7 /client/src/app/videos/video-watch/video-watch.component.ts
parent872a4c7cea861246cf84fa3686bd9d40c684535f (diff)
downloadPeerTube-4f8c0eb0e9356ee2782ea6eb12a92e4dc5f66127.tar.gz
PeerTube-4f8c0eb0e9356ee2782ea6eb12a92e4dc5f66127.tar.zst
PeerTube-4f8c0eb0e9356ee2782ea6eb12a92e4dc5f66127.zip
Client: add ability to report a video
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.ts15
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';
5import { MetaService } from 'ng2-meta'; 5import { MetaService } from 'ng2-meta';
6import * as videojs from 'video.js'; 6import * as videojs from 'video.js';
7 7
8import { AuthService } from '../../core';
8import { VideoMagnetComponent } from './video-magnet.component'; 9import { VideoMagnetComponent } from './video-magnet.component';
9import { VideoShareComponent } from './video-share.component'; 10import { VideoShareComponent } from './video-share.component';
11import { VideoReportComponent } from './video-report.component';
10import { Video, VideoService } from '../shared'; 12import { Video, VideoService } from '../shared';
11import { WebTorrentService } from './webtorrent.service'; 13import { 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.');