Skip to content

Commit

Permalink
Flushing the Buffer
Browse files Browse the repository at this point in the history
flushing the buffer if it gets full, there is an append error which causes freeze issues.
  • Loading branch information
Nayan Savla authored Mar 3, 2020
1 parent c285612 commit 0505db9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/controller/buffer-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,7 @@ class BufferController extends EventHandler {
} catch (err) {
// in case any error occured while appending, put back segment in segments table
logger.error(`error while trying to append buffer:${err.message}`);
this.doFlush(); //We flush the buffer to recover from playback freeze issues.
segments.unshift(segment);
let event = { type: ErrorTypes.MEDIA_ERROR, parent: segment.parent };
if (err.code !== 22) {
Expand Down

0 comments on commit 0505db9

Please sign in to comment.