uniapp小程序上传视频
时间: 2023-09-12 16:04:18 浏览: 114
uniapp视频分享预览小程序
在uniapp小程序中,你可以使用uni.chooseVideo()方法选择要上传的视频,并使用uni.uploadFile()方法将选定的视频上传到服务器。下面是一个示例代码供你参考:
```javascript
// 上传视频
async chooseVideo() {
uni.showLoading({ mask: true, title: '上传中...' })
// 选择要上传的视频
const res = await uni.chooseVideo({
maxDuration: 60, // 拍摄视频最长拍摄时间,单位秒。最长支持 60 秒。
sourceType: ['album'], // 从相册选视频,camera 使用相机拍摄,默认为:['album', 'camera']
});
let uploadFile = res<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [uniapp-上传图片、上传视频](https://blog.csdn.net/qq_43551801/article/details/123528864)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [uniapp影视视频H5小程序APP前后端源码](https://download.csdn.net/download/woaitt617/85010064)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文