Remove video not found
This commit is contained in:
parent
696fa4c06b
commit
4a7591e1a8
|
@ -1,11 +1,18 @@
|
||||||
import { NgModule } from '@angular/core'
|
import { NgModule } from '@angular/core'
|
||||||
import { RouterModule, Routes } from '@angular/router'
|
import { RouterModule, Routes } from '@angular/router'
|
||||||
import { PageNotFoundComponent } from './page-not-found.component'
|
import { PageNotFoundComponent } from './page-not-found.component'
|
||||||
|
import { MetaGuard } from '@ngx-meta/core'
|
||||||
|
|
||||||
const pageNotFoundRoutes: Routes = [
|
const pageNotFoundRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
component: PageNotFoundComponent
|
component: PageNotFoundComponent,
|
||||||
|
canActivate: [ MetaGuard ],
|
||||||
|
data: {
|
||||||
|
meta: {
|
||||||
|
title: 'Not found'
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ div {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-top: 50px;
|
margin-top: 150px;
|
||||||
|
|
||||||
font-size: 32px;
|
font-size: 32px;
|
||||||
}
|
}
|
|
@ -1,10 +1,8 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- We need the video container for videojs so we just hide it -->
|
<!-- 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>
|
||||||
|
|
||||||
<div i18n *ngIf="videoNotFound" id="video-not-found">Video not found :'(</div>
|
|
||||||
|
|
||||||
<!-- Video information -->
|
<!-- Video information -->
|
||||||
<div *ngIf="video" class="margin-content video-bottom">
|
<div *ngIf="video" class="margin-content video-bottom">
|
||||||
<div class="video-info">
|
<div class="video-info">
|
||||||
|
|
|
@ -46,7 +46,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
playerElement: HTMLVideoElement
|
playerElement: HTMLVideoElement
|
||||||
userRating: UserVideoRateType = null
|
userRating: UserVideoRateType = null
|
||||||
video: VideoDetails = null
|
video: VideoDetails = null
|
||||||
videoNotFound = false
|
|
||||||
descriptionLoading = false
|
descriptionLoading = false
|
||||||
|
|
||||||
completeDescriptionShown = false
|
completeDescriptionShown = false
|
||||||
|
@ -119,11 +118,6 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
|
||||||
const startTime = this.route.snapshot.queryParams.start
|
const startTime = this.route.snapshot.queryParams.start
|
||||||
this.onVideoFetched(video, startTime)
|
this.onVideoFetched(video, startTime)
|
||||||
.catch(err => this.handleError(err))
|
.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 => {
|
this.torrent = webtorrent.add(magnetOrTorrentUrl, torrentOptions, torrent => {
|
||||||
console.log('Added ' + magnetOrTorrentUrl + '.')
|
console.log('Added ' + magnetOrTorrentUrl + '.')
|
||||||
|
|
||||||
// Pause the old torrent
|
|
||||||
if (oldTorrent) {
|
if (oldTorrent) {
|
||||||
|
// Pause the old torrent
|
||||||
oldTorrent.pause()
|
oldTorrent.pause()
|
||||||
// Pause does not remove actual peers (in particular the webseed peer)
|
// Pause does not remove actual peers (in particular the webseed peer)
|
||||||
oldTorrent.removePeer(oldTorrent['ws'])
|
oldTorrent.removePeer(oldTorrent['ws'])
|
||||||
|
|
||||||
// We use a fake renderer so we download correct pieces of the next file
|
// We use a fake renderer so we download correct pieces of the next file
|
||||||
// This way we'll be able to
|
|
||||||
if (options.delay) {
|
if (options.delay) {
|
||||||
const fakeVideoElem = document.createElement('video')
|
const fakeVideoElem = document.createElement('video')
|
||||||
renderVideo(torrent.files[0], fakeVideoElem, { autoplay: false, controls: false }, (err, renderer) => {
|
renderVideo(torrent.files[0], fakeVideoElem, { autoplay: false, controls: false }, (err, renderer) => {
|
||||||
fakeRenderer = renderer
|
fakeRenderer = renderer
|
||||||
|
|
||||||
if (err) {
|
if (err) console.error('Cannot render new torrent in fake video element.', err)
|
||||||
console.error('Cannot render new torrent in fake video element.', err)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load the future file at the correct time
|
// Load the future file at the correct time
|
||||||
fakeVideoElem.currentTime = this.player.currentTime() + (options.delay / 2000)
|
fakeVideoElem.currentTime = this.player.currentTime() + (options.delay / 2000)
|
||||||
|
|
Loading…
Reference in New Issue