Skip to content

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

Description

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions