ActivityPub-federated video streaming platform using P2P directly in your web browser
Remove video not found
Chocobozzz4a7591e1a8ec
diff --git a/client/src/app/+page-not-found/page-not-found-routing.module.ts b/client/src/app/+page-not-found/page-not-found-routing.module.tsindex 306d2d54d8..e3407099da 100644--- a/client/src/app/+page-not-found/page-not-found-routing.module.ts+++ b/client/src/app/+page-not-found/page-not-found-routing.module.ts@@ -1,11 +1,18 @@import { NgModule } from '@angular/core'import { RouterModule, Routes } from '@angular/router'import { PageNotFoundComponent } from './page-not-found.component'+import { MetaGuard } from '@ngx-meta/core'const pageNotFoundRoutes: Routes = [{path: '',- component: PageNotFoundComponent+ component: PageNotFoundComponent,+ canActivate: [ MetaGuard ],+ data: {+ meta: {+ title: 'Not found'+ }+ }}]diff --git a/client/src/app/+page-not-found/page-not-found.component.scss b/client/src/app/+page-not-found/page-not-found.component.scssindex 05d45f97fe..53b6142e15 100644--- a/client/src/app/+page-not-found/page-not-found.component.scss+++ b/client/src/app/+page-not-found/page-not-found.component.scss@@ -2,7 +2,7 @@ div {height: 100%;width: 100%;text-align: center;- margin-top: 50px;+ margin-top: 150px;font-size: 32px;}\ No newline at end of filediff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.htmlindex d80b633df1..4c650b121b 100644--- a/client/src/app/videos/+video-watch/video-watch.component.html+++ b/client/src/app/videos/+video-watch/video-watch.component.html@@ -1,10 +1,8 @@<div class="row"><!-- We need the video container for videojs so we just hide it -->- <div [hidden]="videoNotFound" id="video-element-wrapper">+ <div id="video-element-wrapper"></div>- <div i18n *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>-<!-- Video information --><div *ngIf="video" class="margin-content video-bottom"><div class="video-info">diff --git a/client/src/app/videos/+video-watch/video-watch.component.ts b/client/src/app/videos/+video-watch/video-watch.component.tsindex 4a67d456e1..7ba8d1fa44 100644--- a/client/src/app/videos/+video-watch/video-watch.component.ts+++ b/client/src/app/videos/+video-watch/video-watch.component.ts@@ -46,7 +46,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {playerElement: HTMLVideoElementuserRating: UserVideoRateType = nullvideo: VideoDetails = null- videoNotFound = falsedescriptionLoading = falsecompleteDescriptionShown = false@@ -119,11 +118,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {const startTime = this.route.snapshot.queryParams.startthis.onVideoFetched(video, startTime).catch(err => this.handleError(err))- },-- error => {- this.videoNotFound = true- console.error(error)})})diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.tsindex 057bc4b2a9..47288c8423 100644--- a/client/src/assets/player/peertube-videojs-plugin.ts+++ b/client/src/assets/player/peertube-videojs-plugin.ts@@ -195,22 +195,19 @@ class PeerTubePlugin extends Plugin {this.torrent = webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => {console.log('Added ' + magnetOrTorrentUrl + '.')- // Pause the old torrentif (oldTorrent) {+ // Pause the old torrentoldTorrent.pause()// Pause does not remove actual peers (in particular the webseed peer)oldTorrent.removePeer(oldTorrent['ws'])// We use a fake renderer so we download correct pieces of the next file- // This way we'll be able toif (options.delay) {const fakeVideoElem = document.createElement('video')renderVideo(torrent.files[0], fakeVideoElem, { autoplay: false, controls: false }, (err, renderer) => {fakeRenderer = renderer- if (err) {- console.error('Cannot render new torrent in fake video element.', err)- }+ if (err) console.error('Cannot render new torrent in fake video element.', err)// Load the future file at the correct timefakeVideoElem.currentTime = this.player.currentTime() + (options.delay / 2000)