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

WeChat small program API audio and video synthesis and processing container


May 18, 2021 WeChat Mini Program Development Document


Table of contents


MediaContainer

Base library 2.9.0 starts to support, and low versions need to be compatible.

It can be created through wx.createMediaContainer.

MediaContainer audio and video processing containers for audio mixing and more



Method:

MediaContainer.addTrack(MediaTrack track)

Base library 2.9.0 starts to support, and low versions need to be compatible.

Add audio or video tracks to the container

Parameters

MediaTrack track

The audio or video track to add


MediaContainer.destroy()

Base library 2.9.0 starts to support, and low versions need to be compatible.

Destroy the container and free up resources


MediaContainer.export()

Base library 2.9.0 starts to support, and low versions need to be compatible.

Merge the tracks within the container and export the video file


MediaContainer.extractDataSource(Object object)

Base library 2.9.0 starts to support, and low versions need to be compatible.

Separate the incoming video source from the track. Tracks are not automatically added to the container to be synthesized.

Parameters

Object object

Property Type The default Required Description
source string Is Video source address, only local files are supported


MediaContainer.removeTrack(MediaTrack track)

Base Library 2.9.0 starts to support, and low versions require compatibility processing.

Remove the audio or video track from the container

Parameters

MediaTrack track

The audio or video track to remove