aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/peertube-videojs-plugin.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-07-16 16:13:35 +0200
committerChocobozzz <me@florianbigard.com>2018-07-16 16:13:35 +0200
commit1f6824c958440ace14f7c7f83c890b848a71f5d9 (patch)
treef8bd7853f4283bfe72745f5ac491b93a3e618276 /client/src/assets/player/peertube-videojs-plugin.ts
parent329d9086601b7ae2127be12166ee8c892c289c6e (diff)
downloadPeerTube-1f6824c958440ace14f7c7f83c890b848a71f5d9.tar.gz
PeerTube-1f6824c958440ace14f7c7f83c890b848a71f5d9.tar.zst
PeerTube-1f6824c958440ace14f7c7f83c890b848a71f5d9.zip
Improve start time param
Can handle 2m42s for example
Diffstat (limited to 'client/src/assets/player/peertube-videojs-plugin.ts')
-rw-r--r--client/src/assets/player/peertube-videojs-plugin.ts8
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/assets/player/peertube-videojs-plugin.ts b/client/src/assets/player/peertube-videojs-plugin.ts
index 3f6fc4cc6..0dcbe49b1 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'
4import { renderVideo } from './video-renderer' 4import { renderVideo } from './video-renderer'
5import './settings-menu-button' 5import './settings-menu-button'
6import { PeertubePluginOptions, VideoJSCaption, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings' 6import { PeertubePluginOptions, VideoJSCaption, VideoJSComponentInterface, videojsUntyped } from './peertube-videojs-typings'
7import { isMobile, videoFileMaxByResolution, videoFileMinByResolution } from './utils' 7import { isMobile, videoFileMaxByResolution, videoFileMinByResolution, timeToInt } from './utils'
8import * as CacheChunkStore from 'cache-chunk-store' 8import * as CacheChunkStore from 'cache-chunk-store'
9import { PeertubeChunkStore } from './peertube-chunk-store' 9import { PeertubeChunkStore } from './peertube-chunk-store'
10import { 10import {
@@ -76,7 +76,7 @@ class PeerTubePlugin extends Plugin {
76 // Disable auto play on iOS 76 // Disable auto play on iOS
77 this.autoplay = options.autoplay && this.isIOS() === false 77 this.autoplay = options.autoplay && this.isIOS() === false
78 78
79 this.startTime = options.startTime 79 this.startTime = timeToInt(options.startTime)
80 this.videoFiles = options.videoFiles 80 this.videoFiles = options.videoFiles
81 this.videoViewUrl = options.videoViewUrl 81 this.videoViewUrl = options.videoViewUrl
82 this.videoDuration = options.videoDuration 82 this.videoDuration = options.videoDuration
@@ -264,8 +264,8 @@ class PeerTubePlugin extends Plugin {
264 // Magnet hash is not up to date with the torrent file, add directly the torrent file 264 // Magnet hash is not up to date with the torrent file, add directly the torrent file
265 if (err.message.indexOf('incorrect info hash') !== -1) { 265 if (err.message.indexOf('incorrect info hash') !== -1) {
266 console.error('Incorrect info hash detected, falling back to torrent file.') 266 console.error('Incorrect info hash detected, falling back to torrent file.')
267 const options = { forcePlay: true } 267 const newOptions = { forcePlay: true, seek: options.seek }
268 return this.addTorrent(this.torrent['xs'], previousVideoFile, options, done) 268 return this.addTorrent(this.torrent['xs'], previousVideoFile, newOptions, done)
269 } 269 }
270 270
271 return console.warn(err) 271 return console.warn(err)