Skip to main content
Use this API to select a video from the device album or record a new video.

Parameters

PropertyTypeRequiredDescription
sourceTypeArrayNoSources: ['album'], ['camera'], or both
maxDurationNumberNoMaximum recording duration in seconds
cameraStringNoDefault camera: front or back
successFunctionNoCallback with video data
failFunctionNoCallback on failure
completeFunctionNoCallback that always executes

Success Callback

PropertyTypeDescription
apFilePathStringLocal path to video
durationNumberVideo duration in seconds
sizeNumberFile size in bytes

Code Example

my.chooseVideo({
  sourceType: ['album', 'camera'],
  maxDuration: 60,
  success: (res) => {
    console.log('Video:', res.apFilePath);
  }
});