Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Small Program API Screen Recorder WebGL screen recorder instance


May 19, 2021 WeChat Mini Program Development Document


Table of contents


MediaRecorder

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

It can be created by wx.createMediaRecorder.

MediaRecorder WebGL Screen Recorder allows you to record and export video files at the end of recording



Method:

MediaRecorder.destroy()

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Destroy the recorder


MediaRecorder.off(string eventName, function callback)

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Cancel listening for recording events. When the corresponding event is triggered, the callback function is no longer executed.

Parameters

string eventName

The name of the event

function callback

The callback function that is executed when the event is triggered


MediaRecorder.on(string eventName, function callback)

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Register the callback function that listens for recording events. When the corresponding event is triggered, the callback function is executed.

Parameters

string eventName

The name of the event

The legal value of eventName

Value Description The lowest version
start Record the start event.
stop Record the end event. Return to the sempFilePath, duration, fileSize

function callback

The callback function that is executed when the event is triggered


MediaRecorder.pause()

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Suspend recording


MediaRecorder.requestFrame(function callback)

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Request the next frame recording and start recording the current frame after a frame rendering is completed in callback

Parameters

function callback


MediaRecorder.resume()

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Resume recording


MediaRecorder.start()

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

Start recording


MediaRecorder.stop()

The base library 2.11.0 starts to support, and the lower version needs to be compatible.

End the recording