直播的时候,摄像头不能动态切换吗?
发布于 6 年前 作者 songyang 13322 次浏览 来自 问答

<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);
  },

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

1 回复

你好,live-pusher不支持动态切换摄像头

回到顶部