Я получаю только первый кадр видео, а затем появляется сообщение «Не удалось добавить буфер»:< /p>
Не удалось выполнить «appendBuffer» в «SourceBuffer»: атрибут
HTMLMediaElement.error не равен нулю
Часть JS-кода:
Код: Выделить всё
if (buffer.updating || queue.length > 0) {
console.log("buffer.updating = " + buffer.updating + " queue.length = " + (queue.length));
queue.push(videoData);
} else {
console.log("else buffer.updating = " + buffer.updating + " queue.length = " + (queue.length));
buffer.appendBuffer(videoData);
}
}
};
var play = function() {
//var mimeType = `video/mp4;codecs="${$scope.codec}"`;
var mimeType = 'video/mp4;codecs="' + codec +'"';
console.log("mimetype = " + mimeType + " is supported = " + MediaSource.isTypeSupported(mimeType));
buffer = mediaSource.addSourceBuffer(mimeType);
buffer.addEventListener('update', function () {
if (queue.length > 0 && !buffer.updating) {
console.log("buffer.appendBuffer");
buffer.appendBuffer(queue.shift());
}
});
video.play();
};
Подробнее здесь: https://stackoverflow.com/questions/448 ... nt-error-a