Created
April 4, 2024 08:23
-
-
Save DhruvamUnikon/6e652633badb5152588985e41cc6cffe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void startListenEvent() { | |
// Callback for updates on the status of other users in the room. | |
// Users can only receive callbacks when the isUserStatusNotify property of ZegoRoomConfig is set to `true` when logging in to the room (loginRoom). | |
ZegoExpressEngine.onRoomUserUpdate = | |
(roomID, updateType, List<ZegoUser> userList) {}; | |
// Callback for updates on the status of the streams in the room. | |
ZegoExpressEngine.onRoomStreamUpdate = | |
(roomID, updateType, List<ZegoStream> streamList, extendedData) { | |
if (updateType == ZegoUpdateType.Add) { | |
for (final stream in streamList) { | |
startPlayStream(stream.streamID); | |
} | |
} else { | |
for (final stream in streamList) { | |
stopPlayStream(stream.streamID); | |
} | |
} | |
}; | |
// Callback for updates on the current user's room connection status. | |
ZegoExpressEngine.onRoomStateUpdate = | |
(roomID, state, errorCode, extendedData) { | |
debugPrint( | |
'onRoomStateUpdate: roomID: $roomID, state: ${state.name}, errorCode: $errorCode, extendedData: $extendedData'); | |
}; | |
// Callback for updates on the current user's stream publishing changes. | |
ZegoExpressEngine.onPublisherStateUpdate = | |
(streamID, state, errorCode, extendedData) { | |
debugPrint( | |
'onPublisherStateUpdate: streamID: $streamID, state: ${state.name}, errorCode: $errorCode, extendedData: $extendedData'); | |
}; | |
ZegoExpressEngine.onCapturedDataRecordStateUpdate = | |
(state, errorCode, configID, channel) { | |
print('_AdvancedVideoCallHolderState.startListenEvent $state'); | |
debugPrint( | |
'onCapturedDataRecordStateUpdate: state: ${state.name}, errorCode: $errorCode, configID: $configID'); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment