aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/assets/player/webtorrent
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-04-02 18:30:26 +0200
committerChocobozzz <me@florianbigard.com>2019-04-02 18:30:26 +0200
commitc47106315ae3c403239cda29c49b4bba51ddccb2 (patch)
tree526d2f3ba284dde6bc8d83699c0a78e86d7860eb /client/src/assets/player/webtorrent
parentf421fa06ada7bb01d91142cc8211a65e2b390d7b (diff)
downloadPeerTube-c47106315ae3c403239cda29c49b4bba51ddccb2.tar.gz
PeerTube-c47106315ae3c403239cda29c49b4bba51ddccb2.tar.zst
PeerTube-c47106315ae3c403239cda29c49b4bba51ddccb2.zip
tslint update
Diffstat (limited to 'client/src/assets/player/webtorrent')
-rw-r--r--client/src/assets/player/webtorrent/peertube-chunk-store.ts6
-rw-r--r--client/src/assets/player/webtorrent/video-renderer.ts2
-rw-r--r--client/src/assets/player/webtorrent/webtorrent-plugin.ts2
3 files changed, 5 insertions, 5 deletions
diff --git a/client/src/assets/player/webtorrent/peertube-chunk-store.ts b/client/src/assets/player/webtorrent/peertube-chunk-store.ts
index 54cc0ea64..66762bef8 100644
--- a/client/src/assets/player/webtorrent/peertube-chunk-store.ts
+++ b/client/src/assets/player/webtorrent/peertube-chunk-store.ts
@@ -131,7 +131,7 @@ export class PeertubeChunkStore extends EventEmitter {
131 // Chunk in store 131 // Chunk in store
132 this.db.transaction('r', this.db.chunks, async () => { 132 this.db.transaction('r', this.db.chunks, async () => {
133 const result = await this.db.chunks.get({ id: index }) 133 const result = await this.db.chunks.get({ id: index })
134 if (result === undefined) return cb(null, new Buffer(0)) 134 if (result === undefined) return cb(null, Buffer.alloc(0))
135 135
136 const buf = result.buf 136 const buf = result.buf
137 if (!opts) return this.nextTick(cb, null, buf) 137 if (!opts) return this.nextTick(cb, null, buf)
@@ -162,13 +162,13 @@ export class PeertubeChunkStore extends EventEmitter {
162 } 162 }
163 163
164 if (this.db) { 164 if (this.db) {
165 await this.db.close() 165 this.db.close()
166 166
167 await this.dropDatabase(this.databaseName) 167 await this.dropDatabase(this.databaseName)
168 } 168 }
169 169
170 if (this.expirationDB) { 170 if (this.expirationDB) {
171 await this.expirationDB.close() 171 this.expirationDB.close()
172 this.expirationDB = null 172 this.expirationDB = null
173 } 173 }
174 174
diff --git a/client/src/assets/player/webtorrent/video-renderer.ts b/client/src/assets/player/webtorrent/video-renderer.ts
index a3415937b..4dce87112 100644
--- a/client/src/assets/player/webtorrent/video-renderer.ts
+++ b/client/src/assets/player/webtorrent/video-renderer.ts
@@ -29,7 +29,7 @@ function renderVideo (
29 29
30function renderMedia (file: any, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) { 30function renderMedia (file: any, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) {
31 const extension = extname(file.name).toLowerCase() 31 const extension = extname(file.name).toLowerCase()
32 let preparedElem: any = undefined 32 let preparedElem: any
33 let currentTime = 0 33 let currentTime = 0
34 let renderer: any 34 let renderer: any
35 35
diff --git a/client/src/assets/player/webtorrent/webtorrent-plugin.ts b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
index c7182acc9..eee3d4db9 100644
--- a/client/src/assets/player/webtorrent/webtorrent-plugin.ts
+++ b/client/src/assets/player/webtorrent/webtorrent-plugin.ts
@@ -347,7 +347,7 @@ class WebTorrentPlugin extends Plugin {
347 if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed() 347 if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed()
348 348
349 // Limit resolution according to player height 349 // Limit resolution according to player height
350 const playerHeight = this.playerElement.offsetHeight as number 350 const playerHeight = this.playerElement.offsetHeight
351 351
352 // We take the first resolution just above the player height 352 // We take the first resolution just above the player height
353 // Example: player height is 530px, we want the 720p file instead of 480p 353 // Example: player height is 530px, we want the 720p file instead of 480p