小程序选择照片和选择视频的时候闪退
发布于 6 年前 作者 minkang 1093 次浏览 来自 问答

- 手机型号:

  • 当前 Bug 的表现(可附上截图)

在拍摄照片,或者拍摄视频的时候,拍完之后,小程序直接闪退到微信首页,而且只有在上述手机(小米4C)上出现这个问题,其他手机没有出现。请问该如何解决。

  • 以下是代码片段

setVideo(){

    var that = this

    wx.chooseVideo({

        sourceType: [‘album’, ‘camera’],

        maxDuration: 60,

        camera: ‘back’,

        success(resC) {

            onsole.log(resC.tempFilePath)

                that.setData({

                    videoTempPah: resC.tempFilePath

                })

                wx.showLoading({

                    title: ‘上传中…’,

                })

                //上传封装

                app.upload({

                    tempFilePath: resC.tempFilePath,

                    success(res){

                    console.log(res)

                    var videoJson = {

                        id: JSON.parse(res.data).data.id,

                        path: JSON.parse(res.data).data.path,

                    }

                    that.data.videoArr.push(videoJson)

                    that.setData({

                        videoArr: that.data.videoArr

                    })

                    wx.hideLoading()

                }

            })

        }

    })

},

3 回复

清理一下手机的缓存以及内存再试下?

一样的问题,用weui的demo试了也是一样

拍摄视频再点选视频进行上传,小程序闪退(问题终端:华为畅玩5C Android6.0.1

回到顶部