重新打开应用是否自动登录判断优化 #18
|
|
@ -115,15 +115,15 @@ export const agora = {
|
||||||
rtcEngine.registerEventHandler({
|
rtcEngine.registerEventHandler({
|
||||||
// 监听本地用户加入频道事件
|
// 监听本地用户加入频道事件
|
||||||
onJoinChannelSuccess: async (connection: RtcConnection, elapsed: number) => {
|
onJoinChannelSuccess: async (connection: RtcConnection, elapsed: number) => {
|
||||||
await onJoinChannelSuccess(connection, elapsed)
|
await onJoinChannelSuccess?.(connection, elapsed)
|
||||||
},
|
},
|
||||||
// 监听远端用户加入频道事件
|
// 监听远端用户加入频道事件
|
||||||
onUserJoined: async (connection: RtcConnection, remoteUid: number, elapsed: number) => {
|
onUserJoined: async (connection: RtcConnection, remoteUid: number, elapsed: number) => {
|
||||||
await onUserJoined(connection, remoteUid, elapsed)
|
await onUserJoined?.(connection, remoteUid, elapsed)
|
||||||
},
|
},
|
||||||
// 监听用户离开频道事件
|
// 监听用户离开频道事件
|
||||||
onUserOffline: async (connection: RtcConnection, remoteUid: number, reason: UserOfflineReasonType) => {
|
onUserOffline: async (connection: RtcConnection, remoteUid: number, reason: UserOfflineReasonType) => {
|
||||||
await onUserOffline(connection, remoteUid, reason)
|
await onUserOffline?.(connection, remoteUid, reason)
|
||||||
},
|
},
|
||||||
// // 视频发布状态改变回调
|
// // 视频发布状态改变回调
|
||||||
// onVideoPublishStateChanged: (source: any, channel: any, oldState: any, newState: any, elapseSinceLastState: any) => {
|
// onVideoPublishStateChanged: (source: any, channel: any, oldState: any, newState: any, elapseSinceLastState: any) => {
|
||||||
|
|
@ -139,19 +139,19 @@ export const agora = {
|
||||||
// },
|
// },
|
||||||
// // 用户音量提示回调。
|
// // 用户音量提示回调。
|
||||||
onAudioVolumeIndication: async (_connection: RtcConnection, speakers: AudioVolumeInfo[], _speakerNumber: number, _totalVolume: number) => {
|
onAudioVolumeIndication: async (_connection: RtcConnection, speakers: AudioVolumeInfo[], _speakerNumber: number, _totalVolume: number) => {
|
||||||
await onAudioVolumeIndication(speakers)
|
await onAudioVolumeIndication?.(speakers)
|
||||||
},
|
},
|
||||||
//通话中每个用户的网络上下行 last mile 质量报告回调。
|
//通话中每个用户的网络上下行 last mile 质量报告回调。
|
||||||
onNetworkQuality: async (connection: RtcConnection, remoteUid: number, txQuality: QualityType, rxQuality: QualityType) => {
|
onNetworkQuality: async (connection: RtcConnection, remoteUid: number, txQuality: QualityType, rxQuality: QualityType) => {
|
||||||
await onNetworkQuality(connection, remoteUid, txQuality, rxQuality)
|
await onNetworkQuality?.(connection, remoteUid, txQuality, rxQuality)
|
||||||
},
|
},
|
||||||
//当前通话相关的统计信息回调。
|
//当前通话相关的统计信息回调。
|
||||||
onRtcStats: async (_connection: RtcConnection, stats: RtcStats) => {
|
onRtcStats: async (_connection: RtcConnection, stats: RtcStats) => {
|
||||||
await onRtcStats(stats)
|
await onRtcStats?.(stats)
|
||||||
},
|
},
|
||||||
// 网络连接状态已改变回调。
|
// 网络连接状态已改变回调。
|
||||||
onConnectionStateChanged: async (connection: RtcConnection, state: ConnectionStateType, reason: ConnectionChangedReasonType) => {
|
onConnectionStateChanged: async (connection: RtcConnection, state: ConnectionStateType, reason: ConnectionChangedReasonType) => {
|
||||||
await onConnectionStateChanged(connection, state, reason)
|
await onConnectionStateChanged?.(connection, state, reason)
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue