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-watch.component.ts13
1 files changed, 7 insertions, 6 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 585ab2e00..66ef0399a 100644
--- a/client/src/app/videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/videos/+video-watch/video-watch.component.ts
@@ -1,9 +1,9 @@
1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core' 1import { Component, ElementRef, NgZone, OnDestroy, OnInit, ViewChild } from '@angular/core'
2import { ActivatedRoute, Router } from '@angular/router' 2import { ActivatedRoute, Router } from '@angular/router'
3import { RedirectService } from '@app/core/routing/redirect.service'
3import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component' 4import { VideoSupportComponent } from '@app/videos/+video-watch/modal/video-support.component'
4import { MetaService } from '@ngx-meta/core' 5import { MetaService } from '@ngx-meta/core'
5import { NotificationsService } from 'angular2-notifications' 6import { NotificationsService } from 'angular2-notifications'
6import { Observable } from 'rxjs/Observable'
7import { Subscription } from 'rxjs/Subscription' 7import { Subscription } from 'rxjs/Subscription'
8import * as videojs from 'video.js' 8import * as videojs from 'video.js'
9import 'videojs-hotkeys' 9import 'videojs-hotkeys'
@@ -64,7 +64,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
64 private authService: AuthService, 64 private authService: AuthService,
65 private notificationsService: NotificationsService, 65 private notificationsService: NotificationsService,
66 private markdownService: MarkdownService, 66 private markdownService: MarkdownService,
67 private zone: NgZone 67 private zone: NgZone,
68 private redirectService: RedirectService
68 ) {} 69 ) {}
69 70
70 get user () { 71 get user () {
@@ -142,7 +143,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
142 .subscribe( 143 .subscribe(
143 status => { 144 status => {
144 this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`) 145 this.notificationsService.success('Success', `Video ${this.video.name} had been blacklisted.`)
145 this.router.navigate(['/videos/list']) 146 this.redirectService.redirectToHomepage()
146 }, 147 },
147 148
148 error => this.notificationsService.error('Error', error.message) 149 error => this.notificationsService.error('Error', error.message)
@@ -247,7 +248,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
247 this.notificationsService.success('Success', `Video ${this.video.name} deleted.`) 248 this.notificationsService.success('Success', `Video ${this.video.name} deleted.`)
248 249
249 // Go back to the video-list. 250 // Go back to the video-list.
250 this.router.navigate([ '/videos/list' ]) 251 this.redirectService.redirectToHomepage()
251 }, 252 },
252 253
253 error => this.notificationsService.error('Error', error.message) 254 error => this.notificationsService.error('Error', error.message)
@@ -313,7 +314,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
313 'This video contains mature or explicit content. Are you sure you want to watch it?', 314 'This video contains mature or explicit content. Are you sure you want to watch it?',
314 'Mature or explicit content' 315 'Mature or explicit content'
315 ) 316 )
316 if (res === false) return this.router.navigate([ '/videos/list' ]) 317 if (res === false) return this.redirectService.redirectToHomepage()
317 } 318 }
318 319
319 if (!this.hasAlreadyAcceptedPrivacyConcern()) { 320 if (!this.hasAlreadyAcceptedPrivacyConcern()) {
@@ -323,7 +324,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
323 'Privacy concern', 324 'Privacy concern',
324 'I accept!' 325 'I accept!'
325 ) 326 )
326 if (res === false) return this.router.navigate([ '/videos/list' ]) 327 if (res === false) return this.redirectService.redirectToHomepage()
327 } 328 }
328 329
329 this.acceptedPrivacyConcern() 330 this.acceptedPrivacyConcern()