当前位置: 首页 > news >正文

中国建设网官方网站企业登录百度热门

中国建设网官方网站企业登录,百度热门,网站建设维护学什么科目,做室内设计的网站有哪些方面云点播是专门应对上传大视频文件的。 腾讯云点播文档:https://cloud.tencent.com/document/product/266/18177 这个文档比较简单,实在不行,把demo下载下来,一看就明白了,然后再揉一下挪到自己的项目里。完事。 getSign…

云点播是专门应对上传大视频文件的。
腾讯云点播文档:https://cloud.tencent.com/document/product/266/18177
这个文档比较简单,实在不行,把demo下载下来,一看就明白了,然后再揉一下挪到自己的项目里。完事。
getSignature: function(callback) {
uni.request({
url: ‘https://www.xxx.com/mnp/zsapi/getSignature.php’,
method: ‘POST’,
data: {
mid: uni.getStorageSync(‘mid’),
token: uni.getStorageSync(‘token’)
},
header: {
‘content-type’: ‘application/x-www-form-urlencoded’
},
success: function(res) {
if (res.data.signature) {
callback(
res.data.signature
);
} else {
return ‘获取签名失败’;
}
}
});
},
ChooseImage(e) {
console.log(e)
let that = this
// 选择多张图片
uni.chooseMedia({
count: 15, // 最多可以选择的图片张数
mediaType: [‘image’, ‘video’],
sizeType: [‘compressed’], // 可以指定是原图还是压缩图
sourceType: [‘album’], // 可以指定来源是相册还是相机
// maxDuration: 30,
// camera: ‘back’,
success: function(res) {
console.log(res, res.tempFiles[0], ‘???’)
if (res.type == ‘video’) {
if (e == ‘0’) {
uni.showToast({
title: ‘第一张必须上次图片’,
duration: 2000,
icon: ‘none’
})
return
}
//选择视频
that.videoFile = res.tempFiles[0]
setTimeout(() => {
that.startUpload(e)
}, 500)

					} else {// 选择图片成功,res.tempFiles 包含选择的图片路径列表uni.showLoading({title: '上传中...'})// console.log(res.tempFiles)that.uploadDIY( res.tempFiles, 0, 0, 0,  res.tempFiles.length,e);returnfor (let i = 0; i < res.tempFiles.length; i++) {uni.uploadFile({url: 'https://www.xxx.com/mnp/zsapi/gongdi_upload.php',filePath: res.tempFiles[i].tempFilePath,name: 'file',formData: {'mid': uni.getStorageSync('mid'),'token': uni.getStorageSync('token'),},success(res) {const data = JSON.parse(res.data.replace('\uFEFF',''))console.log(data)if (data.bs == 'success') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'success'})that.infolist[e].imglist.push(data.img)} else if (data.bs == 'guoqi') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})setTimeout(function() {uni.redirectTo({url: '../../pagesD/login/login'})}, 500)} else {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})}},fail() {uni.showToast({title: '服务器繁忙,请稍后再试',duration: 2000,icon: 'error'})}})}}}})},startUpload(e) {let that = thisuni.showLoading({title: '上传中...',mask: true,})const self = this;const uploader = VodUploader.start({mediaFile: self.videoFile, //必填,把chooseVideo回调的参数(file)传进来getSignature: self.getSignature, //必填,获取签名的函数error: function(result) {console.log("error");console.log(result);// uni.hideLoading();uni.showModal({title: "上传失败",content: JSON.stringify(result),showCancel: false});},progress: function(result) {console.log("progress");console.log(result);// uni.hideLoading();self.progress = parseInt(result.percent * 100)},finish: function(result) {console.log("finish");console.log(result);let brr = []let obj = {}obj.url = result.videoUrlbrr.push(`myvideo${e}`)that.videoarr = brrobj.id =  `myvideo${e}`self.infolist[e].videolist.push(obj)uni.showToast({title: '上传成功',duration: 2000,icon: 'success'})self.reset();}});this.uploader = uploader},uploadDIY(filePaths, successUp, failUp, i, length,e) {let that = thisuni.uploadFile({url: 'https://www.xxxx.com/mnp/zsapi/gongdi_upload.php',filePath: filePaths[i].tempFilePath,name: 'file',formData: {'mid': uni.getStorageSync('mid'),'token': uni.getStorageSync('token'),},success: (res) => {const data = JSON.parse(res.data.replace('\uFEFF',''))if (data.bs == 'success') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'success'})successUp++;// console.log('上传图片成功:', JSON.parse(res.data));// var data = JSON.parse(res.data);// console.log(data)// 把获取到的路径存入imagesurl字符串中that.infolist[e].imglist.push(data.img)// console.log(this.data.imagesurl)} else if (data.bs == 'guoqi') {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})setTimeout(function() {uni.redirectTo({url: '../../pagesD/login/login'})}, 500)} else {uni.showToast({title: data.errmsg,duration: 2000,icon: 'error'})}},fail: (res) => {failUp++;},complete: () => {i++;if (i == length) {// Toast('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');} else { //递归调用uploadDIY函数that.uploadDIY(filePaths, successUp, failUp, i, length,e);}},});},
http://www.dt0577.cn/news/27722.html

相关文章:

  • 做网站上传视频seo研究中心晴天
  • 企业建立网站步骤优化近义词
  • 长春哪家公司做网站好seo标题优化
  • 网站js代码检测seo网站介绍
  • 应用下载旺道seo推广
  • 中国纳溪门户网站建设项目环境影响宁波seo怎么推广
  • 网站广告尺寸友链交易平台
  • 网站推广策划方式十大基本营销方式
  • 设计公司网站套餐微信朋友圈广告如何投放
  • 网页设计ppt模板深圳谷歌优化seo
  • 响应式网站建设公司武汉竞价托管公司
  • 做外贸的网站看啥书高德北斗导航
  • 网站的增加条件设计百度推广竞价排名
  • 聊城网站制作公司电话seo 知乎
  • 网站开发实训要求苏州百度快速排名优化
  • 建网站需要多少钱网店运营与管理
  • 足球网站怎么做的世界新闻最新消息
  • 公司怎么注册官方网站新开传奇网站发布站
  • 嘉兴做美食图片的网站优质的seo网站排名优化软件
  • 陕西手机网站建设公司哪家好江苏企业seo推广
  • 网站标头图片切换什么推广平台好
  • 网络营销名词解释电子商务漯河seo推广
  • 专项培训网站建设方案seo网址优化靠谱
  • 金蝶软件公司简介西安seo外包公司
  • ps网站专题怎么做搜索引擎优化是什么意思啊
  • 有没有专门做中式的设计网站app软件开发
  • 自己做的表白网站大连网络推广公司哪家好
  • 移动端网站是什么网站备案查询系统
  • 江西网站开发公司宽带推广方案
  • 微信小程序投放惠州seo排名公司