X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=client%2Fsrc%2Fapp%2Fvideos%2F%2Bvideo-watch%2Fvideo-watch.component.ts;h=43afbae1a19261df7b159a24d7710eb12e06f3b3;hb=6d88de725321e77486788f64a2e2537f5e6ef0cd;hp=601c6a38da342803f9e3d016dc52490e981cdcc6;hpb=16f7022b06fb76c0b00c23c970bc8df605b0ec63;p=github%2FChocobozzz%2FPeerTube.git 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 601c6a38d..43afbae1a 100644 --- a/client/src/app/videos/+video-watch/video-watch.component.ts +++ b/client/src/app/videos/+video-watch/video-watch.component.ts @@ -57,6 +57,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { videoHTMLDescription = '' likesBarTooltipText = '' hasAlreadyAcceptedPrivacyConcern = false + remoteServerDown = false private videojsLocaleLoaded = false private otherVideos: Video[] = [] @@ -312,15 +313,14 @@ export class VideoWatchComponent implements OnInit, OnDestroy { const errorMessage: string = typeof err === 'string' ? err : err.message if (!errorMessage) return - let message = '' - + // Display a message in the video player instead of a notification if (errorMessage.indexOf('http error') !== -1) { - message = this.i18n('Cannot fetch video from server, maybe down.') - } else { - message = errorMessage + this.flushPlayer() + this.remoteServerDown = true + return } - this.notificationsService.error(this.i18n('Error'), message) + this.notificationsService.error(this.i18n('Error'), errorMessage) } private checkUserRating () { @@ -345,6 +345,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy { // Re init attributes this.descriptionLoading = false this.completeDescriptionShown = false + this.remoteServerDown = false this.updateOtherVideosDisplayed()