wx.chooseVideo没有限制时间,也获取不到时间
发布于 5 年前 作者 taotian 5708 次浏览 来自 问答

wx.chooseVideo没有限制时间提醒,也获取不到时间,没有进行压缩;

组件video ,controls不起作用;

4 回复

???

wx.chooseVideo({
            sourceType: ['camera'],
            maxDuration: 60,
            camera: 'back',
            success: function(res) {
                that.setData({
                    tip: "正在上传视频..."
                })
                if (res.duration > 60) {
                    wx.showToast({
                        title: '视频最长支持60秒!',
                        icon: 'loading',
                        duration: 2000
                    })
                } else {
                    app.upload_file('/Wxdynamic/upload_pic', res.tempFilePath, '', (err, data) => {
                        if (data) {
                            that.setData({
                                choose_video: data,
                                tip: ''
                            })
                        }
                    })
                }
            }
        })

模拟器没有返回其他的字段,真机是可以的

  1. res返回的只有这些呢

  2. errMsg:"chooseVideo:ok"

  3. tempFilePath:"wxfile://tmp_1926729068o6zAJsy7weLLv9r4xFztgdSUerssc98e7c2e065d9ba4cd547cc9d7efa981.MOV"

  4. size取不到

返回的只有路径,其他几个参数都没有啊,怎么解决的

回到顶部