Closed Fanoflix closed 1 year ago
This is a great suggestion @Fanoflix i'll be getting to this soon :)
Here's the proposal for implementing this feature:
The requirement of this request is that we expose custom events to the user so they can execute code on their end as per their use cases.
Expose the following events to the user:
() => void
(audioData) => void
(audioData) => void
(audioData) => void
() => void
onPlayPause: () => void
@Fanoflix Let me know if you have any suggestions on this; otherwise, I'll push this change.
@AbreezaSaleem This seems good enough. I am eager to see your implementation of it!
Feature deployed v1.1.0
Hello @AbreezaSaleem!
I loved this little package and the idea behind it. I can see it being used by many people as it is a quick plug and play recording solution with a customizable player included.
The Basic Idea
Currently there is no way for the users to execute custom code right after starting recording, during recording, after recording ends etc. To solve this we can provide events as props, such as:
onRecordingStart
onRecordingEnd
onPlayStart
onPlayEnd
onRecordingPause
OnRecordingResume
... and more.So that consumers are allowed to execute code on these events as a feature of the npm-package instead of doing it by themselves. This will help consumers to reduce custom boilerplate code that they will inevitably have to write to do such things. Moreover, this feature is a usual feature among other great packages.