Skip to content

Commit

Permalink
fix: Fix #738, #752, #739 (#767)
Browse files Browse the repository at this point in the history
fix: Fix #738, #752, #739 (#767)
  • Loading branch information
littleGnAl authored Sep 22, 2022
1 parent 08a44bb commit f665d5f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@ on:
types: [opened, synchronize]
branches:
- master
- release/**

push:
branches:
- master
- release/**
pull_request:
branches:
- master
- release/**

jobs:
flutter_codestyle_check:
Expand Down
6 changes: 6 additions & 0 deletions lib/src/enums.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2793,6 +2793,12 @@ enum VideoRemoteStateReason {
///
@JsonValue(9)
AudioFallbackRecovery,

///
/// 10: The SDK reports this error code to the local user when a remote user is using the iOS app and the app is in the background. In this case, the local user sees the remote user's video stuck.
///
@JsonValue(10)
SDKInBackground,
}

///
Expand Down
3 changes: 2 additions & 1 deletion lib/src/impl/enum_converter.g.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/src/impl/rtc_engine_event_handler_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@ extension RtcEngineEventHandlerExt on RtcEngineEventHandler {
break;
case 'FacePositionChanged':
if (facePositionChanged != null) {
final rectList = List<Map>.from(newData[2]);
final distanceList = List<int>.from(newData[3]);
final rectList = List<Map>.from(newData[2] ?? []);
final distanceList = List<int>.from(newData[3] ?? []);
final faceInfos = List.generate(
rectList.length,
(index) {
Expand Down
16 changes: 14 additions & 2 deletions lib/src/impl/rtc_engine_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1838,11 +1838,15 @@ class RtcEngineImpl with MediaRecorderImplMixin implements RtcEngine {
}

@override
Future<void> stopScreenCapture() {
return _invokeMethod('callApi', {
Future<void> stopScreenCapture() async {
await _invokeMethod('callApi', {
'apiType': ApiTypeEngine.kEngineStopScreenCapture.index,
'params': jsonEncode({}),
});

if (!kIsWeb && (Platform.isAndroid || Platform.isIOS)) {
await setVideoSource();
}
}

@override
Expand Down Expand Up @@ -2074,4 +2078,12 @@ class RtcEngineImpl with MediaRecorderImplMixin implements RtcEngine {
}),
});
}

/// Set default video source
Future<void> setVideoSource() {
return _invokeMethod('callApi', {
'apiType': ApiTypeEngine.kEngineSetVideoSource.index,
'params': jsonEncode({}),
});
}
}

0 comments on commit f665d5f

Please sign in to comment.