8000 Merge branch 'master' into 0.2.6 · coder-wuyan/flutter-webrtc@608e6c1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 608e6c1

Browse files
authored
Merge branch 'master' into 0.2.6
2 parents 6aaaa0e + 2b301a7 commit 608e6c1

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## Changelog
22

33
--------------------------------------------
4+
45
[0.2.6] - 2020.02.03
56

67
* Fixed the interruption of the Bluetooth headset that was playing music after the plugin started.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ This entry allows your app to access camera and microphone.
3030

3131
### Android
3232

33-
Ensure the following permission is present in your Android Manifest file, located in `<project root>/android/app/src/main/AndroidManifest.xml:
33+
Ensure the following permission is present in your Android Manifest file, located in `<project root>/android/app/src/main/AndroidManifest.xml`:
3434

3535
```xml
3636
<uses-feature android:name="android.hardware.camera" />

android/src/main/java/com/cloudwebrtc/webrtc/FlutterWebRTCPlugin.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,35 @@ private FlutterWebRTCPlugin(Registrar registrar, MethodChannel channel) {
127127
.setVideoDecoderFactory(new DefaultVideoDecoderFactory(eglContext))
128128
.setAudioDeviceModule(audioDeviceModule)
129129
.createPeerConnectionFactory();
130+
131+
rtcAudioManager = RTCAudioManager.create(registrar.context());
132+
// Store existing audio settings and change audio mode to
133+
// MODE_IN_COMMUNICATION for best possible VoIP performance.
134+
Log.d(TAG, "Starting the audio manager...");
135+
rtcAudioManager.start(new RTCAudioManager.AudioManagerEvents() {
136+
// This method will be called each time the number of available audio
137+
// devices has changed.
138+
@Override
139+
public void onAudioDeviceChanged(
140+
RTCAudioManager.AudioDevice audioDevice, Set<RTCAudioManager.AudioDevice> availableAudioDevices) {
141+
onAudioManagerDevicesChanged(audioDevice, availableAudioDevices);
142+
}
143+
});
144+
/*
145+
if (audioManager != null) {
146+
audioManager.stop();
147+
audioManager = null;
148+
}
149+
*/
150+
}
151+
152+
// This method is called when the audio manager reports audio device change,
153+
// e.g. from wired headset to speakerphone.
154+
private void onAudioManagerDevicesChanged(
155+
final RTCAudioManager.AudioDevice device, final Set<RTCAudioManager.AudioDevice> availableDevices) {
156+
Log.d(TAG, "onAudioManagerDevicesChanged: " + availableDevices + ", "
157+
+ "selected: " + device);
158+
// TODO(henrika): add callback handler.
130159
}
131160

132161
private void startAudioManager() {

example/ios/Podfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uncomment this line t 8000 o define a global platform for your project
2-
platform :ios, '9.0'
2+
platform :ios, '10.0'
33
# source 'https://git.coding.net/hging/Specs.git'
44

55
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.

ios/flutter_webrtc.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ A new flutter plugin project.
1616
s.public_header_files = 'Classes/**/*.h'
1717
s.dependency 'Flutter'
1818
s.dependency 'libyuv-iOS'
19-
s.dependency 'GoogleWebRTC', '1.1.27299'
20-
s.ios.deployment_target = '9.0'
19+
s.dependency 'GoogleWebRTC', '1.1.29400'
20+
s.ios.deployment_target = '10.0'
2121
s.static_framework = true
2222
end
2323

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: flutter_webrtc
2-
description: Flutter WebRTC plugin for iOS/Android.
2+
description: Flutter WebRTC plugin for iOS/Android/Destkop/Web.
33
version: 0.2.6
44
homepage: https://github.com/cloudwebrtc/flutter-webrtc
55

0 commit comments

Comments
 (0)
0