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

深圳建站推广深圳开发公司

深圳建站推广,深圳开发公司,网页设计与制作课件张松炎,泰安互联网公司有哪些云点播是专门应对上传大视频文件的。 腾讯云点播文档#xff1a;https://cloud.tencent.com/document/product/266/18177 这个文档比较简单#xff0c;实在不行#xff0c;把demo下载下来#xff0c;一看就明白了#xff0c;然后再揉一下挪到自己的项目里。完事。 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.zqtcl.cn/news/489264/

相关文章:

  • 用什么框架做网站快哪个网站可以自己做名片
  • 免费网站建设ppt模板下载网站设计与程序专业
  • o2o网站设计方案高端定制网站开发设计建站流程
  • 杭州建设公司网站石家庄做网站比较好的公司
  • 英文网站支付怎么做产品做推广都有那些网站
  • 自己做的网站怎么加入微信支付综合性门户网站列举
  • 哪个网站 可以做快递单录入网站怎么做抽奖
  • 网站设计培训班网站域名费用怎么做分录
  • 济南做网站哪里好惠州附近公司做网站建设多少钱
  • 使用oss做静态网站网站广告牌制作教程
  • 外贸看的英文网站公众号模板编辑器
  • 做网站的数据库的步骤阅读网站模板下载
  • 建设网站要钱吗个人养老金制度是什么意思
  • 做h5的网站页面设计软文素材网站
  • 黄冈网站推广软件费用是多少手机网站弹出层插件有哪些
  • wordpress文章链接怎么改怎么优化关键词排名优化
  • 专业做包包的网站好产品网站做营销推广
  • 网站刚建好怎么做能让百度收录湖北黄石网站建设
  • 网站建设拾金手指下拉二一wordpress 插件破解
  • 天津做网站外包公司有哪些美橙互联网站
  • 石家庄网站建设蓝点办公室装修工程
  • 申请网站空间就是申请域名建设机械网站咨询
  • 做美食网站有哪些网站怎么做自响应
  • 衡水网站建设维护宝安官网网站建设比较好的
  • 网站建设的审批重庆建设工程信息网30系统
  • 泉州软件开发培训机构怎么做网站内部链接的优化
  • 网站定位是什么中国it外包公司排名
  • 洛阳微信平台网站建设网站成功案例分析
  • 网站建设在淘宝怎么分类深圳软件开发招聘信息
  • .net如何做网站个人网站的制作