export function uploadVideo() {
return new Promise(resolve => {
uni.chooseVideo({
sourceType: ["album", "camera"],
success: path => {
// console.log(path);
const tempFilePath = path.tempFilePath;
showLoading("视频上传中...", 20000);
uni.uploadFile({
url: uploadUrl,
filePath: tempFilePath,
name: "file",
success: res => {
hideLoading(0);
if (res.statusCode !== 200) return toast("视频上传失败,请重试");
console.log(res.data);
resolve(previewUrl + res.data);
},
fail: err => {
hideLoading(0);
if (err.errMsg.includes("timeout")) {
toast("视频上传超时,请重试");
} else {
toast("视频上传失败,请重试");
}
console.log(err);
},
});
},
});
});
}
模块封装
原创上一篇:Android studio 编译项目 报 Task :library:compileDebugJavaWithJavac FAILED
下一篇:Could not create task ‘:app:minifyReleaseWithR8‘. Cannot query the value of this provider because it
-
Android平台轻量级RTSP服务模块二次封装版调用说明
技术背景在前面的blog,我们发布了Android平台轻量级RTSP服务模块的技术对接说明,好多开发者希望,更黑盒的对接轻量级RTSP服务这块,专注于自身业务逻辑。为此,我们针对Android平台轻量级RTSP服务模块,做了更进一步的封装(LibPublisherWrapper.java)。技术对接本文还是以大牛直播SDK Android平台Camera2Demo为例,如果需要测试轻量级RTSP服
Android RTSP Server Android RTSP服务器 安卓RTSP服务 RTSP服务器 大牛直播SDK -
python模块--Telnetlib模块
telnet模块
ci 用户名 for循环 -
python gui封装 python封装模块
最近有朋友问我如何把自己写的模块封装好,让别人来pip安装。是啊,以往都是自己用pip安装别人封装好的模块,直接拿来用,如果自己写的模块封装好,以后自己用起来也方便,也可以给别人用,还可以拿来装X,一举两三得。其实,过程非常简单,下面,就跟着笔者一步一步的试试吧!第一步:自己写一个模块比如叫mySeflSum.py里面写上: 第二步:在顶层目录下建立setup.pySetup.py中写
python gui封装 pip更新失败 python 封装 python封装 共享的网络如何让自己比别人快 -
jquery怎么在href链接里带参数
在a标签里添加data-ajax="false"或rel="external"属性例:<a data-ajax="false" href="http://www.***.com/help/***.zip">点击下载</a>详解: 外部页面链接JQuery Mobile 主动化了创建ajax站点和法度的过程.默认景象下,当你点击一个链接时会指向
jquery怎么在href链接里带参数 python javascript ViewUI ajax