Remove video not found
This commit is contained in:
parent
696fa4c06b
commit
4a7591e1a8
|
@ -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'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ div {
|
|||
height: 100%;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
margin-top: 50px;
|
||||
margin-top: 150px;
|
||||
|
||||
font-size: 32px;
|
||||
}
|
|
@ -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">
|
||||
|
|
|
@ -46,7 +46,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
playerElement: HTMLVideoElement
|
||||
userRating: UserVideoRateType = null
|
||||
video: VideoDetails = null
|
||||
videoNotFound = false
|
||||
descriptionLoading = false
|
||||
|
||||
completeDescriptionShown = false
|
||||
|
@ -119,11 +118,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
|||
const startTime = this.route.snapshot.queryParams.start
|
||||
this.onVideoFetched(video, startTime)
|
||||
.catch(err => this.handleError(err))
|
||||
},
|
||||
|
||||
error => {
|
||||
this.videoNotFound = true
|
||||
console.error(error)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
|
|
@ -195,22 +195,19 @@ class PeerTubePlugin extends Plugin {
|
|||
this.torrent = webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => {
|
||||
console.log('Added ' + magnetOrTorrentUrl + '.')
|
||||
|
||||
// Pause the old torrent
|
||||
if (oldTorrent) {
|
||||
// Pause the old torrent
|
||||
oldTorrent.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 to
|
||||
if (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 time
|
||||
fakeVideoElem.currentTime = this.player.currentTime() + (options.delay / 2000)
|
||||
|
|
Loading…
Reference in New Issue