Browse Source

订阅屏幕分享流状态变化

yourname 7 months ago
parent
commit
60b8f8e6c7
1 changed files with 13 additions and 1 deletions
  1. 13 1
      client/mobile/pages_classroom.tsx

+ 13 - 1
client/mobile/pages_classroom.tsx

@@ -323,7 +323,7 @@ export const ClassroomPage = () => {
       channelId: string
     ) => {
       console.log(`视频订阅状态变化: 用户 ${userId}, 旧状态 ${oldState}, 新状态 ${newState}`);
-      
+
       switch(newState) {
         case 3: // 订阅成功
           try {
@@ -378,6 +378,18 @@ export const ClassroomPage = () => {
           console.warn(`未知订阅状态: ${newState}`);
       }
     });
+
+    
+    // 订阅屏幕分享流状态变化
+    aliRtcEngine.current.on('screenShareSubscribeStateChanged', (
+      userId: string,
+      oldState: AliRtcSubscribeState,
+      newState: AliRtcSubscribeState,
+      elapseSinceLastState: number,
+      channel: string
+    ) => {
+      console.log(`屏幕分享订阅状态变更:uid=${userId}, oldState=${oldState}, newState=${newState}`);
+    })
   };
 
   // 获取学生列表