From b224ddd88b767b9a6402e3648993b4f2707057ef Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Aug 2018 10:23:01 +0200 Subject: [PATCH] Fix player playback (video never ends) --- client/src/assets/player/peertube-chunk-store.ts | 8 +++++++- client/src/assets/player/peertube-player-local-storage.ts | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/src/assets/player/peertube-chunk-store.ts b/client/src/assets/player/peertube-chunk-store.ts index e14e31c04..767e46821 100644 --- a/client/src/assets/player/peertube-chunk-store.ts +++ b/client/src/assets/player/peertube-chunk-store.ts @@ -118,7 +118,13 @@ export class PeertubeChunkStore extends EventEmitter { // IndexDB could be slow, use our memory index first const memoryChunk = this.memoryChunks[index] - if (memoryChunk === undefined) return cb(null, new Buffer(0)) + if (memoryChunk === undefined) { + const err = new Error('Chunk not found') + err['notFound'] = true + + return process.nextTick(() => cb(err)) + } + // Chunk in memory if (memoryChunk !== true) return cb(null, memoryChunk) diff --git a/client/src/assets/player/peertube-player-local-storage.ts b/client/src/assets/player/peertube-player-local-storage.ts index 6882f68a6..dac54c5a4 100644 --- a/client/src/assets/player/peertube-player-local-storage.ts +++ b/client/src/assets/player/peertube-player-local-storage.ts @@ -52,7 +52,6 @@ function getAverageBandwidthInStore () { return undefined } - // --------------------------------------------------------------------------- export { -- 2.41.0