问题描述
我有一个 media recorder,我像这样实例化:
const mediaRecorder = new MediaRecorder(stream,{
mimeType: 'video/x-matroska;codecs=h264',videoBitsPerSecond: 2500000,audioBitsPerSecond: 128000,});
mediaRecorder.ondataavailable = (e) => {
const blobUrl = URL.createObjectURL(e.data);
try {
const hyperlink = document.createElement('a');
hyperlink.href = blobUrl;
hyperlink.target = '_blank';
hyperlink.download = 'some_file_name_' + Date.now();
const evt = new MouseEvent('click',{
view: globalThis.window,bubbles: true,cancelable: true
});
hyperlink.dispatchEvent(evt);
} finally {
URL.revokeObjectURL(blobUrl);
}
};
mediaRecorder.start(5000);
这段代码在我的下载文件夹中留下了许多小文件。我想将它们连接在一起,我使用 Node 的 appendFile
API 做到了这一点。问题是视频文件在第一段之后无法正确播放。有人对调试这个有什么建议吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)