花了一个多礼拜,终于开发出来了。使用FFmpeg自主研发,不需要依赖第三方SDK。
给大家看看效果
使用说明:
<template>
<view class="content">
<button @click="callNativeVideoCropUI">裁剪视频</button>
<button @click="callNativeVideoBgMusicUI">添加背景音乐</button>
<button @click="callNativeVideoCompressUI">压缩视频</button>
<button @click="callNativeRecodeVideo">拍照/录屏</button>
<button @click="callNativeVideoPlayer">视频播放器</button>
<button @click="callNativeSelectLocalVideo">选择视频</button>
<view class="text-area">
<text class="title">数据返回:{{title}}</text>
</view>
</view>
</template>
<script>
// 获取 module
var getModel = uni.requireNativePlugin("YGVEModule");
const modal = uni.requireNativePlugin('modal');
export default {
onLoad() {
},
data() {
return {
title: '',
}
},
methods: {
callNativeVideoCropUI() {
const _this = this;
getModel.callNativeVideoCropUI({
'outFilePath': '1',
},
(ret) => {
_this.title = JSON.stringify(ret);
})
},
callNativeVideoBgMusicUI() {
const _this = this;
var ret = getModel.callNativeVideoBgMusicUI({
'outFilePath': '1',
},
(ret) => {
_this.title = JSON.stringify(ret);
})
},
callNativeVideoCompressUI() {
const _this = this;
var ret = getModel.callNativeVideoCompressUI({
'outFilePath': '1',
},
(ret) => {
_this.title = JSON.stringify(ret);
})
},
callNativeRecodeVideo() {
const _this = this;
var ret = getModel.callNativeRecodeVideo({
'outFilePath': '1',
},
(ret) => {
_this.title = JSON.stringify(ret);
})
},
callNativeVideoPlayer() {
var ret = getModel.callNativeVideoPlayer({
'url': 'http://vfx.mtime.cn/Video/2019/03/18/mp4/190318231014076505.mp4',
})
},
callNativeSelectLocalVideo() {
const _this = this;
var ret = getModel.callNativeSelectLocalVideo({
'url': '1',
},
(ret) => {
_this.title = JSON.stringify(ret);
})
}
}
}
</script>
App Demo下载链接:https://wwa.lanzous.com/i5Tcwfhpnlg
分享博主的网站:https://yuange.828707.cn/
QQ 2729404527