uni.chooseVideo(OBJECT)
https://ask.dcloud.net.cn/article/35547。 平台差异说明 OBJECT 参数说明 success 返回参数说明 注意:
- uni.saveFile,在应用下次启动时才能访问得到。
- 视频压缩插件示例
<template> <view> <text>hello</text> <button @tap="test">click me</button> <video :src="src"></video> </view></template>
export default { data: { src: '' }, methods: { test: function () { var self = this; uni.chooseVideo({ count: 1, sourceType: ['camera', 'album'], success: function (res) { self.src = res.tempFilePath; } }); } }}
uni.saveVideoToPhotosAlbum(OBJECT)
保存视频到系统相册。 平台差异说明 OBJECT 参数说明 success 返回参数说明 示例<template> <view> <text>hello</text> <button @tap="test">click me</button> <video :src="src"></video> </view></template>
export default { data: { src: '' }, methods: { test: function () { var self = this; uni.chooseVideo({ count: 1, sourceType: ['camera'], success: function (res) { self.src = res.tempFilePath; uni.saveVideoToPhotosAlbum({ filePath: res.tempFilePath, success: function () { console.log('save success'); } }); } }); } }}
在 GitHub 上编辑此页面!
