yangjie #49

Merged
yangqiang merged 71 commits from yangjie into master 2025-03-10 14:21:26 +08:00
2 changed files with 18 additions and 3 deletions
Showing only changes of commit 32acac493d - Show all commits

View File

@ -1448,6 +1448,17 @@ const Meeting: React.FC = () => {
onAudioPublishStateChanged: (_channel: string, _oldState: StreamPublishState, newState: StreamPublishState, _elapseSinceLastState: number) => { onAudioPublishStateChanged: (_channel: string, _oldState: StreamPublishState, newState: StreamPublishState, _elapseSinceLastState: number) => {
setAudioStatus(newState) setAudioStatus(newState)
}, },
onActiveSpeaker: (_connection: RtcConnection, uid: number) => {
GetSharedScreen(state.channelId).then(req => {
if (req.code === 200) {
if (req.data) {
setIsShare(req.data)
} else {
renderVideo(String(uid))
}
}
})
}
}) })
if (state.enableCamera) { if (state.enableCamera) {
await agora.startCameraCapture() await agora.startCameraCapture()
@ -1767,8 +1778,8 @@ const Meeting: React.FC = () => {
if (res) { if (res) {
GetSharedScreen(state.channelId).then(req => { GetSharedScreen(state.channelId).then(req => {
if (req.code === 200) { if (req.code === 200) {
if (res.data) { if (req.data) {
setIsShare(res.data) setIsShare(req.data)
} }
getDesktopCapturerVideo() getDesktopCapturerVideo()
setIsSharedScreenModal(true) setIsSharedScreenModal(true)

View File

@ -152,7 +152,7 @@ export const agora = {
}, 1000); }, 1000);
}, },
// 事件回调 // 事件回调
registerEventHandler: ({ onJoinChannelSuccess, onUserJoined, onUserOffline, onAudioVolumeIndication, onRtcStats, onConnectionStateChanged, onLocalVideoStateChanged, onConnectionLost, onTokenPrivilegeWillExpire, onVideoPublishStateChanged, onAudioPublishStateChanged }: any) => { registerEventHandler: ({ onJoinChannelSuccess, onUserJoined, onUserOffline, onAudioVolumeIndication, onRtcStats, onConnectionStateChanged, onLocalVideoStateChanged, onConnectionLost, onTokenPrivilegeWillExpire, onActiveSpeaker, onVideoPublishStateChanged, onAudioPublishStateChanged }: any) => {
rtcEngine.registerEventHandler({ rtcEngine.registerEventHandler({
// 监听本地用户加入频道事件 // 监听本地用户加入频道事件
onJoinChannelSuccess: async (connection: RtcConnection, elapsed: number) => { onJoinChannelSuccess: async (connection: RtcConnection, elapsed: number) => {
@ -197,6 +197,10 @@ export const agora = {
// Token 即将在 30s 内过期回调。 // Token 即将在 30s 内过期回调。
onTokenPrivilegeWillExpire: (connection: RtcConnection, token: string) => { onTokenPrivilegeWillExpire: (connection: RtcConnection, token: string) => {
onTokenPrivilegeWillExpire?.(connection, token) onTokenPrivilegeWillExpire?.(connection, token)
},
// 监测到远端最活跃用户回调。
onActiveSpeaker: (connection: RtcConnection, uid: number) => {
onActiveSpeaker?.(connection, uid)
} }
}); });
}, },