const recorderManager = getRecorderManager();
recorderManager.onStart((e)=>{
console.log('start',e)
})
recorderManager.onStop((e)=>{
console.log('stop',e)
})
recorderManager.start({
})
setTimeout(() => {
recorderManager.stop();
}, 3000);
{
duration: 2000,
fileSize: 0,
tempFilePath: "blob:http://localhost:8989/7474aafc-53b1-4147-9158-44c4c228f156"}
recorderManager.onFrameRecorded((e)=>{
console.log('onFrameRecorded',e)
})
上面的代码输出的文件是空的
但是如果加了
就正常
然后我们看到源文件https://github.com/raxjs/universal-api/blob/286d77035e/src/packages/media/recorder/src/web/index.ts#L114
这个确实是只有我们调用onFrameRecorded才会开始监听ondataavailable,才有切片