uni.chooseMedia({
mediaType: ['mix'],
sourceType: ['album', 'camera'],
maxDuration: 30,
camera: 'back',
success(res) {
console.log(res)
},
fail(err) {
console.log(err)
},
})
android机型 同时选择图片视频返回:
{
"tempFiles": [
{
"tempFilePath": "wxfile://tmp_3bcb77e5ceb3aa8bf72748cd3c46bd894754dcd8920b7fad.jpg",
"size": 180005,
"fileType": "image"
},
{
"tempFilePath": "wxfile://tmp_5f2b18cc38c13560486d1b82b76d17ed2c6314c2074b8f40.jpg",
"size": 143061,
"fileType": "image"
},
{
"tempFilePath": "wxfile://tmp_3de54b4a36c887fe54da7d9313cfbb7d49287e81db538115.mp4",
"thumbTempFilePath": "wxfile://tmp_cbb3cd687781b65cfb6203d0a3cf87cabbb5495e633fb06adda5cd358a0a4613.jpeg",
"duration": 37,
"height": 796,
"width": 360,
"size": 1720754,
"fileType": "video"
},
{
"tempFilePath": "wxfile://tmp_6d4fec2435bf4e4d310b03f6cb716f908490ebcea8b7ea74.mp4",
"thumbTempFilePath": "wxfile://tmp_89929d0867feb2e386ad4dc75b97221bba4ca3d43395aef46c0638ecaf30f9c3.jpeg",
"duration": 36,
"height": 796,
"width": 360,
"size": 2636341,
"fileType": "video"
}
],
"type": "mix",
"errMsg": "chooseMedia:ok"
}
ios 机型 选择视频返回:
{"tempFiles":[],"errMsg":"chooseMedia:fail","type":"mix","failedCount":1}