RtcRoomContext
解释: swan.createRtcRoomContext 的返回值。
示例
扫码体验
代码示例
请使用百度APP扫码
图片示例
代码示例
- SWAN
- JS
<view class="wrap">
<rtc-room
id="myRoom"
bindstatechange="handleStateChange">
<rtc-room-item
type="local"
userId="{{localUserId}}">
</rtc-room-item>
<view>
<rtc-room-item
type="remote"
userId="{{remoteUserId}}"
class="remote-view">
</rtc-room-item>
</view>
</rtc-room>
<button bindtap="exitRoom">挂断</button>
<button bindtap="getRemoteUserList">获取房间中所有远端用户列表</button>
<view s-if="remoteUserList">用户列表:{{remoteUserList}}</view>
<button bindtap="getRemoteAudioLevels">获取房间中所有远端用户音量级别</button>
<button bindtap="unpublishLocalStream">取消发布本地音视频流</button>
<button bindtap="subscribeRemoteStream">订阅远端音视频流</button>
<button bindtap="unsubscribeRemoteStream">取消订阅远端音视频流</button>
<button bindtap="setRemoteVideoPlayState">暂停/恢复远端画面</button>
<button bindtap="setRemoteAudioPlayState">静音/恢复远端声音</button>
<button bindtap="switchCamera">切换前后置摄像头</button>
</view>