diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 15:39:08 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-10-19 15:39:08 +0200 |
commit | efee3505f6582ba76f8ad22ad4796e214f078bcc (patch) | |
tree | c5431de93c56bb914d9aa0e20762b22468d6cf01 /client/src/app/videos/+video-watch | |
parent | a96aed15188174c50885dda0df3164a67295e11f (diff) | |
download | PeerTube-efee3505f6582ba76f8ad22ad4796e214f078bcc.tar.gz PeerTube-efee3505f6582ba76f8ad22ad4796e214f078bcc.tar.zst PeerTube-efee3505f6582ba76f8ad22ad4796e214f078bcc.zip |
Fix bug when quitting NSFW video
Diffstat (limited to 'client/src/app/videos/+video-watch')
-rw-r--r-- | client/src/app/videos/+video-watch/video-watch.component.ts | 12 |
1 files changed, 6 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 651298c14..8b5abc3f3 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts | |||
@@ -36,7 +36,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
36 | uploadSpeed: number | 36 | uploadSpeed: number |
37 | userRating: UserVideoRateType = null | 37 | userRating: UserVideoRateType = null |
38 | video: Video = null | 38 | video: Video = null |
39 | videoNotFound = false | 39 | videoPlayerLoaded = false |
40 | 40 | ||
41 | private paramsSub: Subscription | 41 | private paramsSub: Subscription |
42 | 42 | ||
@@ -58,17 +58,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
58 | this.videoService.getVideo(uuid).subscribe( | 58 | this.videoService.getVideo(uuid).subscribe( |
59 | video => this.onVideoFetched(video), | 59 | video => this.onVideoFetched(video), |
60 | 60 | ||
61 | error => { | 61 | error => console.error(error) |
62 | console.error(error) | ||
63 | this.videoNotFound = true | ||
64 | } | ||
65 | ) | 62 | ) |
66 | }) | 63 | }) |
67 | } | 64 | } |
68 | 65 | ||
69 | ngOnDestroy () { | 66 | ngOnDestroy () { |
70 | // Remove player if it exists | 67 | // Remove player if it exists |
71 | if (this.videoNotFound === false) { | 68 | if (this.videoPlayerLoaded === true) { |
72 | videojs(this.playerElement).dispose() | 69 | videojs(this.playerElement).dispose() |
73 | } | 70 | } |
74 | 71 | ||
@@ -223,6 +220,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
223 | observable.subscribe( | 220 | observable.subscribe( |
224 | res => { | 221 | res => { |
225 | if (res === false) { | 222 | if (res === false) { |
223 | |||
226 | return this.router.navigate([ '/videos/list' ]) | 224 | return this.router.navigate([ '/videos/list' ]) |
227 | } | 225 | } |
228 | 226 | ||
@@ -241,6 +239,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy { | |||
241 | } | 239 | } |
242 | } | 240 | } |
243 | 241 | ||
242 | this.videoPlayerLoaded = true | ||
243 | |||
244 | const self = this | 244 | const self = this |
245 | videojs(this.playerElement, videojsOptions, function () { | 245 | videojs(this.playerElement, videojsOptions, function () { |
246 | self.player = this | 246 | self.player = this |