<live-pusher id='livePusher' ref="livePusher" class="livePusher" :class="{'active':isShow}" :url="url" mode="SD" :muted="true"
:enable-camera="true" :auto-focus="true" :beauty="1" whiteness="2" aspect="9:16" @statechange="statechange"
@netstatus="netstatus" @error="error">
</live-pusher>
</template>
<script>
onReady() {
········
var that = this
this.recorderManager = uni.getRecorderManager();
this.innerAudioContext = uni.createInnerAudioContext();
this.innerAudioContext.autoplay = true;
this.context = uni.createLivePusherContext("livePusher", this);
this.recorderManager.onStop(function(res) {
console.log('recorder stop' + JSON.stringify(res));
that.voicePath = res.tempFilePath;
that.saveGame()
});
},
method:{
startRecord() {
console.log('开始录音');
this.recorderManager.start();
},
endRecord() {
console.log('录音结束');
this.recorderManager.stop();
},
start: function() {
const that = this;
this.context.start({
success: (a) => {
console.log("livePusher.start:" + JSON.stringify(a));
}
});
},
}
</script>
- 发布:2021-12-03 17:20
- 更新:2021-12-10 15:03
- 阅读:343
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10 家庭中文版20H2
HBuilderX类型: 正式
HBuilderX版本号: 3.2.12
手机系统: Android
手机系统版本号: Android 7.1.1
手机机型: 一体机
页面类型: nvue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
示例代码:
操作步骤:
开启推流,推流成功后,开始录音,录音时推流黑屏停止,录音不受影响
开启推流,推流成功后,开始录音,录音时推流黑屏停止,录音不受影响
预期结果:
推流和录音相不干扰
推流和录音相不干扰
实际结果:
推流和录音相冲突干扰
推流和录音相冲突干扰
bug描述:
刚开始推流时成功的,一旦开启录音,推流就会画面黑屏停止
1 个回复
DCloud_Android_DQQ
给个可以复现问题的示例