# MediaRecorder.on(string eventName, function callback)
Start from base library version 2.11.0. Please remaining backward compatible.
with Promise style call: Not supported
Mini Program plugin: Support
Registers callback functions for listening to recorded events. When the corresponding event triggers, the callback function is executed.
# parameter
# string eventName
Event name
eventName Legal value
value | Introductions | Minimum version |
---|---|---|
start | Record the start event. | |
stop | Record the end event. return {tempFilePath, duration, fileSize} | |
pause | Record pause events. | |
resume | Record continuing events. | |
timeupdate | Record time update events. |
# function callback
A callback function executed when an event is triggered