aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/videos/video-watch
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/videos/video-watch')
-rw-r--r--client/src/app/videos/video-watch/video-report.component.ts11
-rw-r--r--client/src/app/videos/video-watch/video-watch.component.ts8
2 files changed, 11 insertions, 8 deletions
diff --git a/client/src/app/videos/video-watch/video-report.component.ts b/client/src/app/videos/video-watch/video-report.component.ts
index 7a125f53e..19a7af148 100644
--- a/client/src/app/videos/video-watch/video-report.component.ts
+++ b/client/src/app/videos/video-watch/video-report.component.ts
@@ -2,6 +2,7 @@ import { Component, Input, OnInit, ViewChild } from '@angular/core';
2import { FormBuilder, FormGroup } from '@angular/forms'; 2import { FormBuilder, FormGroup } from '@angular/forms';
3 3
4import { ModalDirective } from 'ng2-bootstrap/modal'; 4import { ModalDirective } from 'ng2-bootstrap/modal';
5import { NotificationsService } from 'angular2-notifications';
5 6
6import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared'; 7import { FormReactive, VideoAbuseService, VIDEO_ABUSE_REASON } from '../../shared';
7import { Video, VideoService } from '../shared'; 8import { Video, VideoService } from '../shared';
@@ -26,7 +27,8 @@ export class VideoReportComponent extends FormReactive implements OnInit {
26 27
27 constructor( 28 constructor(
28 private formBuilder: FormBuilder, 29 private formBuilder: FormBuilder,
29 private videoAbuseService: VideoAbuseService 30 private videoAbuseService: VideoAbuseService,
31 private notificationsService: NotificationsService
30 ) { 32 ) {
31 super(); 33 super();
32 } 34 }
@@ -56,13 +58,12 @@ export class VideoReportComponent extends FormReactive implements OnInit {
56 58
57 this.videoAbuseService.reportVideo(this.video.id, reason) 59 this.videoAbuseService.reportVideo(this.video.id, reason)
58 .subscribe( 60 .subscribe(
59 // TODO: move alert to beautiful notifications 61 () => {
60 ok => { 62 this.notificationsService.success('Success', 'Video reported.');
61 alert('Video reported.');
62 this.hide(); 63 this.hide();
63 }, 64 },
64 65
65 err => alert(err.text) 66 err => this.notificationsService.error('Error', err.text);
66 ) 67 )
67 } 68 }
68} 69}
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 5cd7550be..c27133f74 100644
--- a/client/src/app/videos/video-watch/video-watch.component.ts
+++ b/client/src/app/videos/video-watch/video-watch.component.ts
@@ -1,8 +1,9 @@
1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'; 1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core';
2import { ActivatedRoute } from '@angular/router'; 2import { ActivatedRoute } from '@angular/router';
3 3
4import { MetaService } from 'ng2-meta';
5import * as videojs from 'video.js'; 4import * as videojs from 'video.js';
5import { MetaService } from 'ng2-meta';
6import { NotificationsService } from 'angular2-notifications';
6 7
7import { AuthService } from '../../core'; 8import { AuthService } from '../../core';
8import { VideoMagnetComponent } from './video-magnet.component'; 9import { VideoMagnetComponent } from './video-magnet.component';
@@ -45,7 +46,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
45 private videoService: VideoService, 46 private videoService: VideoService,
46 private metaService: MetaService, 47 private metaService: MetaService,
47 private webTorrentService: WebTorrentService, 48 private webTorrentService: WebTorrentService,
48 private authService: AuthService 49 private authService: AuthService,
50 private notificationsService: NotificationsService
49 ) {} 51 ) {}
50 52
51 ngOnInit() { 53 ngOnInit() {
@@ -117,7 +119,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
117 console.log('Added ' + this.video.magnetUri + '.'); 119 console.log('Added ' + this.video.magnetUri + '.');
118 torrent.files[0].renderTo(this.playerElement, { autoplay: true }, (err) => { 120 torrent.files[0].renderTo(this.playerElement, { autoplay: true }, (err) => {
119 if (err) { 121 if (err) {
120 alert('Cannot append the file.'); 122 this.notificationsService.error('Error', 'Cannot append the file in the video element.');
121 console.error(err); 123 console.error(err);
122 } 124 }
123 }); 125 });