Skip to main content
Version: Next

MediaContainer

Create an audio/video processing container, which can eventually be used to combine the tracks in the container into a single video.

Reference

Methods

addTrack

Adding an audio or video track to a container.

Reference

(track: MediaTrack) => void
PropertyTypeDescription
trackMediaTrackAudio or video track to be added

API Support

APIWeChat Mini-ProgramH5React Native
MediaContainer.addTrack✔️

destroy

Destroy the container and release the resources

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
MediaContainer.destroy✔️

export

Merge the tracks in the container and export the video file

Reference

() => void

API Support

APIWeChat Mini-ProgramH5React Native
MediaContainer.export✔️

extractDataSource

Separates tracks from the incoming video source. Does not automatically add tracks to the container to be composited.

Reference

(option: ExtractDataSourceOption) => void
PropertyType
optionExtractDataSourceOption

API Support

APIWeChat Mini-ProgramH5React Native
MediaContainer.extractDataSource✔️

removeTrack

Remove the audio or video track from the container.

Reference

(track: MediaTrack) => void
PropertyTypeDescription
trackMediaTrackAudio or video track to be removed

API Support

APIWeChat Mini-ProgramH5React Native
MediaContainer.removeTrack✔️

Parameters

ExtractDataSourceOption

PropertyTypeDescription
sourcestringVideo source address, local file support only

API Support

APIWeChat Mini-ProgramH5React Native
MediaContainer.addTrack✔️
MediaContainer.destroy✔️
MediaContainer.export✔️
MediaContainer.extractDataSource✔️
MediaContainer.removeTrack✔️