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

WeChat small program API screen recorder - create WebGL screen recorder


May 19, 2021 WeChat Mini Program Development Document


Table of contents


MediaRecorder wx.createMediaRecorder(Object canvas, Object options)

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

Create a WebGL screen recorder that records images rendered on WebGL frame by frame and exports video files

Parameters

Object canvas

WebGL object, the node object obtained through SelectorQuery

Object options

Property Type The default Required Description
duration number 600 Whether Specifies the length of the recording (s) and reaches automatic stop. Maximum 7200, min 5
videoBitsPerSecond number 1000 Whether Video bit rate (kbps), minimum 600, maximum 3000
gop number 12 Whether Video key frame interval
Fps number 24 Whether Video fps

Returns a value

MediaRecorder