diff options
Diffstat (limited to 'client')
-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 |