|
@@ -175,6 +175,8 @@ class VideoFragment : BaseFragment<VideoVm>() {
|
|
|
}
|
|
}
|
|
|
isSwitchRoom = false
|
|
isSwitchRoom = false
|
|
|
sd_bgView.toGone()
|
|
sd_bgView.toGone()
|
|
|
|
|
+
|
|
|
|
|
+ loadMicList()
|
|
|
} else {
|
|
} else {
|
|
|
Log.d(TAG, "joinChannel: 222222")
|
|
Log.d(TAG, "joinChannel: 222222")
|
|
|
sd_bgView.toGone()
|
|
sd_bgView.toGone()
|
|
@@ -186,6 +188,7 @@ class VideoFragment : BaseFragment<VideoVm>() {
|
|
|
// 停止本地预览
|
|
// 停止本地预览
|
|
|
engine?.stopPreview()
|
|
engine?.stopPreview()
|
|
|
engine?.stopPlayingStream(viewModel.room?.anchorId.toString())
|
|
engine?.stopPlayingStream(viewModel.room?.anchorId.toString())
|
|
|
|
|
+ stopMicList()
|
|
|
// 停止推流
|
|
// 停止推流
|
|
|
engine?.stopPublishingStream()
|
|
engine?.stopPublishingStream()
|
|
|
// 退出房间
|
|
// 退出房间
|
|
@@ -206,6 +209,33 @@ class VideoFragment : BaseFragment<VideoVm>() {
|
|
|
engine?.stopPublishingStream()
|
|
engine?.stopPublishingStream()
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 加载所有连麦用户麦序
|
|
|
|
|
+ */
|
|
|
|
|
+ fun loadMicList() {
|
|
|
|
|
+ if (viewModel.room?.micList?.size == 0) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ for (i in viewModel.room?.micList?.indices!!) {
|
|
|
|
|
+ val mic = viewModel.room?.micList?.get(i)
|
|
|
|
|
+ Log.d("videoFragment", "loadMicList: " + mic?.userId)
|
|
|
|
|
+ val playStreamId = mic?.userId.toString() // 播放流ID, 人的ID
|
|
|
|
|
+ engine?.startPlayingStream(playStreamId)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ fun stopMicList() {
|
|
|
|
|
+ if (viewModel.room?.micList?.size == 0) {
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ for (i in viewModel.room?.micList?.indices!!) {
|
|
|
|
|
+ val mic = viewModel.room?.micList?.get(i)
|
|
|
|
|
+ Log.d("videoFragment", "stopMicList: " + mic?.userId)
|
|
|
|
|
+ val playStreamId = mic?.userId.toString() // 播放流ID, 人的ID
|
|
|
|
|
+ engine?.stopPlayingStream(playStreamId)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/******************** 连麦 *****************/
|
|
/******************** 连麦 *****************/
|
|
|
|
|
|
|
|
fun anchorBack(isBackground: Boolean) {
|
|
fun anchorBack(isBackground: Boolean) {
|