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 {