收藏
回答

直播的时候,摄像头不能动态切换吗?

<live-pusher url="rtmp://*******/live/{{rtmp_key}}" autopush beauty="7" whiteness="5" mode="SD" device-position="{{cameraStatus}}" class="livePusher" bindstatechange="statechange"

/>

<view class="livecamera" bindtap="camera" >

  <cover-image style="width:60rpx;height:60rpx" src="/images/livecamera.png"></cover-image>
</view>
camera: function (){
    let that = this;
    let cameraTo = "";
    if(that.data.cameraStatus == "front"){
      cameraTo = "back";
    }else{
      cameraTo = "front";
    }
    that.setData({
      cameraStatus: cameraTo
    })
    console.log("摄像头", that.data.cameraStatus);
  },

打印的值在变了,但是摄像头没换?求解答

最后一次编辑于  2019-12-11
回答关注问题邀请回答
收藏

1 个回答

登录 后发表内容
问题标签