目前动态设置 mode 属性没有做到动态生效,需要重新 stop 再 start,具体请参考如下使用方式:
onChangeMode: function () {
var self = this;
this.data.videoContext = wx.createLivePlayerContext("video-livePlayer");
if (this.data.mode == "live") {
this.setData({ mode: "RTC"}, function () {
self.data.videoContext.stop();
self.data.videoContext.play();
});
}
else {
this.setData({ mode: "live"}, function () {
self.data.videoContext.stop();
self.data.videoContext.play();
});
}
},
相似问题