aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-06-08 15:35:18 +0200
committerChocobozzz <me@florianbigard.com>2018-06-08 15:35:18 +0200
commit4a7591e1a8ec5ffdff85580c6be4b18d8b85b4d4 (patch)
treefc167d50569885006ee6911819dce634586231e2
parent696fa4c06b2351983740eb617ad46eb8eeb2c4e8 (diff)
downloadPeerTube-4a7591e1a8ec5ffdff85580c6be4b18d8b85b4d4.tar.gz
PeerTube-4a7591e1a8ec5ffdff85580c6be4b18d8b85b4d4.tar.zst
PeerTube-4a7591e1a8ec5ffdff85580c6be4b18d8b85b4d4.zip
Remove video not found
-rw-r--r--client/src/app/+page-not-found/page-not-found-routing.module.ts9
-rw-r--r--client/src/app/+page-not-found/page-not-found.component.scss2
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.html4
-rw-r--r--client/src/app/videos/+video-watch/video-watch.component.ts6
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts7
5 files changed, 12 insertions, 16 deletions
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.ts
index 306d2d54d..e3407099d 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 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { PageNotFoundComponent } from './page-not-found.component' 3import { PageNotFoundComponent } from './page-not-found.component'
4import { MetaGuard } from '@ngx-meta/core'
4 5
5const pageNotFoundRoutes: Routes = [ 6const pageNotFoundRoutes: Routes = [
6 { 7 {
7 path: '', 8 path: '',
8 component: PageNotFoundComponent 9 component: PageNotFoundComponent,
10 canActivate: [ MetaGuard ],
11 data: {
12 meta: {
13 title: 'Not found'
14 }
15 }
9 } 16 }
10] 17]
11 18
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.scss
index 05d45f97f..53b6142e1 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 {
2 height: 100%; 2 height: 100%;
3 width: 100%; 3 width: 100%;
4 text-align: center; 4 text-align: center;
5 margin-top: 50px; 5 margin-top: 150px;
6 6
7 font-size: 32px; 7 font-size: 32px;
8} \ No newline at end of file 8} \ No newline at end of file
diff --git a/client/src/app/videos/+video-watch/video-watch.component.html b/client/src/app/videos/+video-watch/video-watch.component.html
index d80b633df..4c650b121 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 @@
1<div class="row"> 1<div class="row">
2 <!-- We need the video container for videojs so we just hide it --> 2 <!-- We need the video container for videojs so we just hide it -->
3 <div [hidden]="videoNotFound" id="video-element-wrapper"> 3 <div id="video-element-wrapper">
4 </div> 4 </div>
5 5
6 <div i18n *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
7
8 <!-- Video information --> 6 <!-- Video information -->
9 <div *ngIf="video" class="margin-content video-bottom"> 7 <div *ngIf="video" class="margin-content video-bottom">
10 <div class="video-info"> 8 <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.ts
index 4a67d456e..7ba8d1fa4 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 {
46 playerElement: HTMLVideoElement 46 playerElement: HTMLVideoElement
47 userRating: UserVideoRateType = null 47 userRating: UserVideoRateType = null
48 video: VideoDetails = null 48 video: VideoDetails = null
49 videoNotFound = false
50 descriptionLoading = false 49 descriptionLoading = false
51 50
52 completeDescriptionShown = false 51 completeDescriptionShown = false
@@ -119,11 +118,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
119 const startTime = this.route.snapshot.queryParams.start 118 const startTime = this.route.snapshot.queryParams.start
120 this.onVideoFetched(video, startTime) 119 this.onVideoFetched(video, startTime)
121 .catch(err => this.handleError(err)) 120 .catch(err => this.handleError(err))
122 },
123
124 error => {
125 this.videoNotFound = true
126 console.error(error)
127 } 121 }
128 ) 122 )
129 }) 123 })
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index 057bc4b2a..47288c842 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 {
195 this.torrent = webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => { 195 this.torrent = webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => {
196 console.log('Added ' + magnetOrTorrentUrl + '.') 196 console.log('Added ' + magnetOrTorrentUrl + '.')
197 197
198 // Pause the old torrent
199 if (oldTorrent) { 198 if (oldTorrent) {
199 // Pause the old torrent
200 oldTorrent.pause() 200 oldTorrent.pause()
201 // Pause does not remove actual peers (in particular the webseed peer) 201 // Pause does not remove actual peers (in particular the webseed peer)
202 oldTorrent.removePeer(oldTorrent['ws']) 202 oldTorrent.removePeer(oldTorrent['ws'])
203 203
204 // We use a fake renderer so we download correct pieces of the next file 204 // We use a fake renderer so we download correct pieces of the next file
205 // This way we'll be able to
206 if (options.delay) { 205 if (options.delay) {
207 const fakeVideoElem = document.createElement('video') 206 const fakeVideoElem = document.createElement('video')
208 renderVideo(torrent.files[0], fakeVideoElem, { autoplay: false, controls: false }, (err, renderer) => { 207 renderVideo(torrent.files[0], fakeVideoElem, { autoplay: false, controls: false }, (err, renderer) => {
209 fakeRenderer = renderer 208 fakeRenderer = renderer
210 209
211 if (err) { 210 if (err) console.error('Cannot render new torrent in fake video element.', err)
212 console.error('Cannot render new torrent in fake video element.', err)
213 }
214 211
215 // Load the future file at the correct time 212 // Load the future file at the correct time
216 fakeVideoElem.currentTime = this.player.currentTime() + (options.delay / 2000) 213 fakeVideoElem.currentTime = this.player.currentTime() + (options.delay / 2000)