更新记录
1.1.0(2024-04-10)
修复编译时stopCommand错误问题。
1.0.9(2024-04-10)
修复编译时stopCommand错误问题。
1.0.8(2024-04-10)
处理编译时stopCommand警告问题。
查看更多平台兼容性
Vue2 | Vue3 |
---|---|
√ | √ |
App | 快应用 | 微信小程序 | 支付宝小程序 | 百度小程序 | 字节小程序 | QQ小程序 |
---|---|---|---|---|---|---|
HBuilderX 3.6.8,Android:4.4,iOS:11 | × | × | × | × | × | × |
钉钉小程序 | 快手小程序 | 飞书小程序 | 京东小程序 |
---|---|---|---|
× | × | × | × |
H5-Safari | Android Browser | 微信浏览器(Android) | QQ浏览器(Android) | Chrome | IE | Edge | Firefox | PC-Safari |
---|---|---|---|---|---|---|---|---|
× | × | × | × | × | × | × | × | × |
概述
XF-ffmpegPlusUTS封装了在Android和iOS中执行ffmpeg的命令对进行音视频处理的逻辑
插件接口
executeCommand
执行ffmpeg命令
uni-app项目中(vue/nvue)调用示例:
import { executeCommand } from "@/uni_modules/XF-ffmpegPlusUTS"
executeCommand({
cmd: "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { executeCommand } from "@/uni_modules/XF-ffmpegPlusUTS";
import { CommandOptions } from "@/uni_modules/XF-ffmpegPlusUTS/utssdk/interface.uts";
let options = {
cmd: "",
complete: (res : any) => {
console.log(res)
}
} as CommandOptions;
executeCommand(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
executeCommandSync
执行ffmpeg命令
uni-app项目中(vue/nvue)调用示例:
import { executeCommandSync } from "@/uni_modules/XF-ffmpegPlusUTS"
executeCommandSync("");
uni-app x项目(uvue)中调用示例:
import { executeCommandSync } from "@/uni_modules/XF-ffmpegPlusUTS";
executeCommandSync("");
可用性
iOS、Android系统
可提供的1.0.0及更高版本
stopCommand
停止执行ffmpeg命令
uni-app项目中(vue/nvue)调用示例:
import { stopCommand } from "@/uni_modules/XF-ffmpegPlusUTS"
stopCommand({
sessionId : 1,
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { stopCommand } from "@/uni_modules/XF-ffmpegPlusUTS";
import { StopCommandOptions } from "@/uni_modules/XF-ffmpegPlusUTS/utssdk/interface.uts";
let options = {
sessionId : 1,
complete: (res : any) => {
console.log(res)
}
} as StopCommandOptions;
stopCommand(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
start
音乐合成
uni-app项目中(vue/nvue)调用示例:
import { audioMerge } from "@/uni_modules/XF-m3u8CacheServerUTS"
audioMerge({
onePath : "",
twoPath : "",
targetPath : "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { audioMerge } from "@/uni_modules/XF-m3u8CacheServerUTS";
import { AudioMergeOptions } from "@/uni_modules/XF-m3u8CacheServerUTS/utssdk/interface.uts";
let options = {
onePath : "",
twoPath : "",
targetPath : "",
complete: (res : any) => {
console.log(res)
}
} as AudioMergeOptions;
audioMerge(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
videoMerge
视频合成
uni-app项目中(vue/nvue)调用示例:
import { videoMerge } from "@/uni_modules/XF-ffmpegPlusUTS"
videoMerge({
videoPath : "",
audioPath : "",
argetPath : "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { videoMerge } from "@/uni_modules/XF-ffmpegPlusUTS";
import { VideoMergeOptions } from "@/uni_modules/XF-ffmpegPlusUTS/utssdk/interface.uts";
let options = {
videoPath : "",
audioPath : "",
argetPath : "",
complete: (res : any) => {
console.log(res)
}
} as VideoMergeOptions;
videoMerge(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
isDownloadFinish
获取文件信息
uni-app项目中(vue/nvue)调用示例:
import { getFileInfo } from "@/uni_modules/XF-ffmpegPlusUTS"
getFileInfo({
path : "",
complete: (res) => {
console.log(res)
}
});
uni-app x项目(uvue)中调用示例:
import { getFileInfo } from "@/uni_modules/XF-ffmpegPlusUTS";
import { FileOptions } from "@/uni_modules/XF-ffmpegPlusUTS/utssdk/interface.uts";
let options = {
path : "",
complete: (res : any) => {
console.log(res)
}
} as FileOptions;
getFileInfo(options);
可用性
iOS、Android系统
可提供的1.0.0及更高版本
getFileInfoSync
获取文件信息
uni-app项目中(vue/nvue)调用示例:
import { getFileInfoSync } from "@/uni_modules/XF-ffmpegPlusUTS"
getFileInfoSync("");
uni-app x项目(uvue)中调用示例:
import { getFileInfoSync } from "@/uni_modules/XF-ffmpegPlusUTS";
getFileInfoSync("");
可用性
iOS、Android系统
可提供的1.0.0及更高版本