Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] RecorderManager在web端如果没有监听onFrameRecorded,stop的时候文件就是空白的 #281

Open
yiescc opened this issue Oct 19, 2022 · 0 comments

Comments

@yiescc
Copy link

yiescc commented Oct 19, 2022

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,才有切片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant