react-media-recorder icon indicating copy to clipboard operation
react-media-recorder copied to clipboard

Add recording duration

Open preveenraj opened this issue 4 years ago • 6 comments

preveenraj avatar Sep 20 '21 19:09 preveenraj

You could control the duration (by calling start and stop ) from the parent container itself, right?

DeltaCircuit avatar Oct 05 '21 06:10 DeltaCircuit

I wanted to get the overall the duration in seconds of the recorded video. Currently, I am using a package called get-blob-duration to achieve this. However, this has performance impacts. Any workaround on this? @0x006F

preveenraj avatar Oct 05 '21 08:10 preveenraj

I don't think you'd need a secondary package to get the duration. We have full control over startRecording and stopRecording from the parent's context itself. Keeping a timer between this would immediately solve your performance hit.

That being said, this could be handled from the library itself also. This emitting of blob's meta properties wasn't included in the design plan to be honest 😄 . But this could be a start.

Let me know if you want to open a PR for this.

DeltaCircuit avatar Oct 05 '21 08:10 DeltaCircuit

That workaround is doable. Thanks for bringing it up. By the way, implementing blob's meta properties would be great. I believe people could make best value out of it. And thanks a lot for the package. You rock it.

preveenraj avatar Oct 05 '21 08:10 preveenraj

You can also get the duration if you assign the mediaBlobUrl to an <audio> or <video> element, I used react-use/useAudio for this.

JanMisker avatar Nov 09 '21 23:11 JanMisker

The screen recording is downloaded as a .wav audio file. If recording a screen the content should be a video. Maybe Line 229 condition can be as (audio ? { type: "audio/wav" } : { type: "video/mp4" })

AB2954 avatar May 04 '22 06:05 AB2954