Create android & web plugins (#15)

* create android & web plugins

* apply `flutter format .`
This commit is contained in:
Hiroshi Horie
2021-10-02 15:20:41 +09:00
committed by GitHub
parent 1a87bcf860
commit 48e03b84cb
43 changed files with 1200 additions and 356 deletions
+7 -3
View File
@@ -89,7 +89,8 @@ class _ControlsWidgetState extends State<ControlsWidget> {
void _toggleCamera() async {
//
final track = participant.videoTracks.firstOrNull?.track as LocalVideoTrack?;
final track =
participant.videoTracks.firstOrNull?.track as LocalVideoTrack?;
if (track == null) return;
try {
@@ -113,7 +114,8 @@ class _ControlsWidgetState extends State<ControlsWidget> {
}
try {
final screenTrack = await LocalVideoTrack.createScreenTrack(); // Defaults to camera
final screenTrack =
await LocalVideoTrack.createScreenTrack(); // Defaults to camera
await widget.room.localParticipant.publishVideoTrack(
screenTrack,
);
@@ -177,7 +179,9 @@ class _ControlsWidgetState extends State<ControlsWidget> {
icon: const Icon(EvaIcons.videoOff),
),
IconButton(
icon: Icon(position == CameraPosition.back ? EvaIcons.camera : EvaIcons.person),
icon: Icon(position == CameraPosition.back
? EvaIcons.camera
: EvaIcons.person),
onPressed: () => _toggleCamera(),
),
IconButton(
+2 -1
View File
@@ -50,7 +50,8 @@ class _ParticipantWidgetState extends State<ParticipantWidget> {
// register for change so Flutter will re-build the widget upon change
void _onParticipantChanged() {
//
final firstAudio = widget.participant.audioTracks.firstWhereOrNull((pub) => pub.subscribed);
final firstAudio = widget.participant.audioTracks
.firstWhereOrNull((pub) => pub.subscribed);
final firstVideo = widget.participant.videoTracks
.firstWhereOrNull((pub) => !pub.isScreenShare && pub.subscribed);