react-media-recorder
react-media-recorder copied to clipboard
Add recording duration
You could control the duration (by calling start and stop ) from the parent container itself, right?
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
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.
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.
You can also get the duration if you assign the mediaBlobUrl to an <audio> or <video> element, I used react-use/useAudio for this.
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" })