X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;ds=sidebyside;f=client%2Fsrc%2Fassets%2Fplayer%2Fpeertube-videojs-plugin.ts;h=4b0677faba6dc43f9a85e8e22277371bf919c7a5;hb=ad77475251c3516dd5851a08655be79d7bf76245;hp=3f6fc4cc6c2b307e2a9c136c47ffd1de25485ed7;hpb=16f7022b06fb76c0b00c23c970bc8df605b0ec63;p=github%2FChocobozzz%2FPeerTube.git diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts index 3f6fc4cc6..4b0677fab 100644 --- a/client/src/assets/player/peertube-videojs-plugin.ts +++ b/client/src/assets/player/peertube-videojs-plugin.ts @@ -4,7 +4,7 @@ import { VideoFile } from '../../../../shared/models/videos/video.model' import { renderVideo } from './video-renderer' import './settings-menu-button' import { PeertubePluginOptions, VideoJSCaption, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' -import { isMobile, videoFileMaxByResolution, videoFileMinByResolution } from './utils' +import { isMobile, videoFileMaxByResolution, videoFileMinByResolution, timeToInt } from './utils' import * as CacheChunkStore from 'cache-chunk-store' import { PeertubeChunkStore } from './peertube-chunk-store' import { @@ -76,7 +76,7 @@ class PeerTubePlugin extends Plugin { // Disable auto play on iOS this.autoplay = options.autoplay && this.isIOS() === false - this.startTime = options.startTime + this.startTime = timeToInt(options.startTime) this.videoFiles = options.videoFiles this.videoViewUrl = options.videoViewUrl this.videoDuration = options.videoDuration @@ -264,11 +264,16 @@ class PeerTubePlugin extends Plugin { // Magnet hash is not up to date with the torrent file, add directly the torrent file if (err.message.indexOf('incorrect info hash') !== -1) { console.error('Incorrect info hash detected, falling back to torrent file.') - const options = { forcePlay: true } - return this.addTorrent(this.torrent['xs'], previousVideoFile, options, done) + const newOptions = { forcePlay: true, seek: options.seek } + return this.addTorrent(this.torrent['xs'], previousVideoFile, newOptions, done) } - return console.warn(err) + // Remote instance is down + if (err.message.indexOf('from xs param') !== -1) { + this.handleError(err) + } + + console.warn(err) }) } @@ -585,7 +590,7 @@ class PeerTubePlugin extends Plugin { this.player.options_.inactivityTimeout = 0 } const enableInactivity = () => { - // this.player.options_.inactivityTimeout = saveInactivityTimeout + this.player.options_.inactivityTimeout = saveInactivityTimeout } const settingsDialog = this.player.children_.find(c => c.name_ === 'SettingsDialog')