小程序上传图片和视频代码实例-怎样给小程序上传视频-微信小程序视频上传
js页面//拍照camera:function(that){wx.chooseImage({count:1,sizeType:['original','compressed'],sourceType:["camera"],success:function(res){consttempFilePathsres.tempFilePaths;that.uploadFile(tempFilePaths);},})},//从相册选取album:function(that){wx.chooseImage({count:1,sizeType:['original','compressed'],sourceType:["album"],success:function(res){consttempFilePathsres.tempFilePathsthat.uploadFile(tempFilePaths);},})},//拍摄视频video:function(that){wx.chooseVideo({sourceType:['album','camera'],compressed:'',maxDuration:60,success:function(res){consttempFilePathsres.tempFilePaths;that.uploadFile(tempFilePaths);},})},//上传uploadFile:function(filePath){wx.uploadFile({url:'',filePath:filePath,name:'',header:{},formData:{},success:function(res){},fail:function(res){},complete:function(res){},})}`
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

