camera在iPhone下录像没有声音
发布于 6 年前 作者 zmo 4049 次浏览 来自 问答

很无语,希望快点解决。

5 回复
_this.cameraCtx.startRecord({
                    success() {
                      //添加流 控制时间
                      let stream = xs
                        .periodic(1000)
                        .endWhen(xs.periodic(11000).take(1));
 
                      stream.addListener({
                        next: i => {
                          _this.countDownTip = "还剩 " + (10 - i) + " 秒";
                          _this.$apply();
                        },
                        error: err => console.error(err),
                        complete: () => {
                          //录制时间到,停止录制
                          _this.countDownTip = "还剩 0 秒";
                          _this.$apply();
                          _this.cameraCtx.stopRecord({
                            success(res) {
                              wx.showLoading({
                                title: "请稍后……",
                                mask: true
                              });
                              //处理视频
                              _this.$preload(
                                "tempThumbPath",
                                res.tempThumbPath
                              );
                              _this.$preload(
                                "tempVideoPath",
                                res.tempVideoPath
                              );
                              _this.$redirect({
                                url: "playvideo"
                              });
                              wx.hideLoading();
                              console.log(res);
                            },
                            fail(res) {
                              wx.showToast({
                                title: "无法结束录像!" + res.errMessage,
                                icon: "none"
                              });
                            }
                          });
                        }
                      });
                    },
                    fail(res) {
                      wx.showToast({
                        title: "无法开始录像!" + res.errMessage,
                        icon: "none"
                      });
                    }
                  });

当中用到了xstream(http://staltz.github.io/xstream/)的库

题主, 可以用chooseVideo API , 我都服了 自己写了个, 原来就有

到现在都没有解决

你好,请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码示例。

不止是Iphone

我android也是 我以为是故意静音的,

微信版本6.6.5

基础库1.9.9

手机 华为畅玩6x 权限都给了

复现代码

回到顶部