I have two videos name v11.webm and v12.webm.
What i want is that these two videos should run seamlessly without any gap.
I am following the media source a
Just set the sourceBuffer's mode to 'sequence' (default seems to be 'segments')
From the doc: https://developer.mozilla.org/en-US/docs/Web/API/SourceBuffer/mode
sequence: The order in which the segments are appended to the SourceBuffer determines the order in which they are played. Segment timestamps are generated automatically for the segments that observe this order.
In my app, I just set it after adding the the source buffer to the media source:
// Create media source for the stream, and create the source buffer when ready
let self = this;
this._mediaSource = new MediaSource();
this._mediaSource.addEventListener('sourceopen', function () {
self._sourceBuffer = self.mediaSource.addSourceBuffer(environment.recordingMimeType);
self._sourceBuffer.mode = 'sequence'; // This is the relevant part
self._sourceBuffer.addEventListener('error', function (ev) {
console.error("Source buffer error ??");
console.error(ev);
});
});