Skip to content

Commit

Permalink
Fix malfunctioning json deserialization of volume indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
dannnnthemannnn committed Apr 26, 2024
1 parent 0052cc7 commit 6b0f2ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/src/binding/agora_rtc_engine_event_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,15 @@ class RtcEngineEventHandlerWrapper implements EventLoopEventHandler {
return true;
}
final jsonMap = jsonDecode(eventData);
if (jsonMap['totalVolume'] is bool) {
jsonMap['totalVolume'] = 0;
}
for(final user in jsonMap['speakers']) {
if (user['uid'] is String) {
final newValue = int.tryParse(user['uid']);
user['uid'] = newValue;
}
}
RtcEngineEventHandlerOnAudioVolumeIndicationJson paramJson =
RtcEngineEventHandlerOnAudioVolumeIndicationJson.fromJson(jsonMap);
paramJson = paramJson.fillBuffers(buffers);
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ version: 6.3.0
homepage: https://www.agora.io
repository: https://github.com/AgoraIO-Extensions/Agora-Flutter-SDK/tree/main
environment:
sdk: '>=2.14.0 <3.0.0'
sdk: '>3.0.0'
flutter: '>=2.5.0'
dependencies:
flutter:
Expand Down

0 comments on commit 6b0f2ae

Please sign in to comment.