Create a Twilio Programmable Video flutter package for Android
Problem to solve
To be able to use Twilio Programmable Video in Flutter a package should be created since there isn't an existing package already.
Use-cases
- Video calling on Android
Proposal
Create a Flutter package that wraps the SDK and exposes some of it's API to be able to create the first PoC example application.
Links/references
Tasks
-
Create documentation on howto use within the README.md -
Add the latest Twilio Programmable Video Android SDK to the Flutter package: https://www.twilio.com/docs/video/android-getting-started-v5#gradle -
Make sure to add the proguard rules as well (add to readme): https://www.twilio.com/docs/video/android-getting-started-v5#proguard -
Make sure to set the minimum API level to 16 or higher: https://www.twilio.com/docs/video/android-getting-started-v5#supported-devices - Create methods for:
-
Connect to a room -
Join a room -
Publishing microphone and camera - Audio only
- Video only
- Add audio or video to a session from above
- Directly start with audio/video
- https://www.twilio.com/docs/video/android-getting-started-v5#display-a-camera-preview
-
Setting up listeners -
Display a Remote Participant's Video -
Switching camera -
Mute/unmute microphone -
Mute/unmute camera -
Disconnect from a Room
-
Audio improvements / notices when tested on Android
-
We need control over setting speaker phone or not and default set to speaker phone: https://www.twilio.com/docs/video/android-configuring-audio-video-input-and-output-devices-v5#selecting-a-specific-audio-output. If we could toggle this in Dart maybe we could use the proximity sensor to switch to audio only and through headphone instead of speaker. -
This should get implemented: https://github.com/twilio/video-quickstart-android#configuring-audiomanager. During the test I only tested setting the audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);Also check the React Native plugin which has a lot of working implementations of the audioManager: https://github.com/blackuy/react-native-twilio-video-webrtc/blob/master/android/src/main/java/com/twiliorn/library/CustomTwilioVideoView.java -
Pixel 2 phone needs software echo cancellation, see https://github.com/twilio/video-quickstart-android#configuring-hardware-audio-effects. - List of models that needs software echo cancellation: https://github.com/signalapp/Signal-Android/blob/72e10ac5974eddd03d48a8bd4c12581db9c4b50b/app/src/main/java/org/thoughtcrime/securesms/ApplicationContext.java#L297
-
Wrap android widget
Quirks/Bugs
- There is currently a bug with gradle: https://github.com/twilio/video-quickstart-android/issues/430
- Temporary fix, add
android.enableDexingArtifactTransform.desugaring=falseto projectgradle.properties.
- Temporary fix, add
Edited by Jochum van der Ploeg