May 19, 2021 WeChat Mini Program Development Document
The base library 2.11.0 starts to support, and the lower version needs to be compatible.
It can be created via wx.createVideoDecode r.
VideoDecoder video decoder, you can do video decoding related operations, frame by frame to obtain decoding data
The base library 2.11.0 starts to support, and the lower version needs to be compatible.
Gets the decoding data for the next frame
Video frame data, if not taken, returns null. Data may not be paused when the buffer is empty.
Property | Type | Description |
---|---|---|
width | number | Frame data width |
height | number | Frame data height |
data | ArrayBuffer | Frame data |
pkPts | number | Frame original pts |
pkDts | number | Frame original dts |
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
The name of the event
The callback function that is executed when the event is triggered
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
The name of the event
The legal value of eventName
Value | Description | The lowest version |
---|---|---|
start | Start the event. Back to s width, height | |
stop | End the event. | |
seek | Seek completes the event. | |
bufferchange | Buffer change event. | |
ended | Decode the end event. |
The callback function that is executed when the event is triggered
The base library 2.11.0 starts to support, and the lower version needs to be compatible.
Remove the decoder
The base library 2.11.0 starts to support, and the lower version needs to be compatible.
Jump to a point in time to decode
The decoding position of the jump, in ms
The base library 2.11.0 starts to support, and the lower version needs to be compatible.
Start decoding
Property | Type | The default | Required | Description |
---|---|---|---|---|
source | string | Is | Video source files that need to be decoded only support local paths | |
mode | number | 1 | Whether | Decoding mode. 0: Decode by pts;1: Decode as fast as possible |
The base library 2.11.0 starts to support, and the lower version needs to be compatible.
Stop decoding