diff options
Diffstat (limited to 'client/src/app/videos')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 6 |
1 files changed, 4 insertions, 2 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 d7c7b7497..21a24113f 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -34,6 +34,7 @@ import { VideoWatchPlaylistComponent } from '@app/videos/+video-watch/video-watc | |||
34 | import { getStoredTheater } from '../../../assets/player/peertube-player-local-storage' | 34 | import { getStoredTheater } from '../../../assets/player/peertube-player-local-storage' |
35 | import { PluginService } from '@app/core/plugins/plugin.service' | 35 | import { PluginService } from '@app/core/plugins/plugin.service' |
36 | import { HooksService } from '@app/core/plugins/hooks.service' | 36 | import { HooksService } from '@app/core/plugins/hooks.service' |
37 | import { PlatformLocation } from '@angular/common' | ||
37 | 38 | ||
38 | @Component({ | 39 | @Component({ |
39 | selector: 'my-video-watch', | 40 | selector: 'my-video-watch', |
@@ -95,6 +96,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
95 | private i18n: I18n, | 96 | private i18n: I18n, |
96 | private hotkeysService: HotkeysService, | 97 | private hotkeysService: HotkeysService, |
97 | private hooks: HooksService, | 98 | private hooks: HooksService, |
99 | private location: PlatformLocation, | ||
98 | @Inject(LOCALE_ID) private localeId: string | 100 | @Inject(LOCALE_ID) private localeId: string |
99 | ) {} | 101 | ) {} |
100 | 102 | ||
@@ -374,13 +376,13 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
374 | this.i18n('This video contains mature or explicit content. Are you sure you want to watch it?'), | 376 | this.i18n('This video contains mature or explicit content. Are you sure you want to watch it?'), |
375 | this.i18n('Mature or explicit content') | 377 | this.i18n('Mature or explicit content') |
376 | ) | 378 | ) |
377 | if (res === false) return this.redirectService.redirectToHomepage() | 379 | if (res === false) return this.location.back() |
378 | } | 380 | } |
379 | 381 | ||
380 | // Flush old player if needed | 382 | // Flush old player if needed |
381 | this.flushPlayer() | 383 | this.flushPlayer() |
382 | 384 | ||
383 | // Build video element, because videojs remove it on dispose | 385 | // Build video element, because videojs removes it on dispose |
384 | const playerElementWrapper = this.elementRef.nativeElement.querySelector('#videojs-wrapper') | 386 | const playerElementWrapper = this.elementRef.nativeElement.querySelector('#videojs-wrapper') |
385 | this.playerElement = document.createElement('video') | 387 | this.playerElement = document.createElement('video') |
386 | this.playerElement.className = 'video-js vjs-peertube-skin' | 388 | this.playerElement.className = 'video-js vjs-peertube-skin' |