* add audio_session package * `AudioManager` initial design * try to integrate audio manager * configure audio session * `DisposeAware` disposing if already published causes exception. * organize * guard flutter_webrtc calls * websocket async fix * use `ConnectionState` instead of `_isClosed` and `isReconnecting` * change create audio track defaults * update protos * protocol 3 speaker updates * fix exception * emit `RoomDisconnectedEvent` only once * fix exception * keep track of local / remote audio tracks * explicit types * manage track state * re-structure audio management * change defaults * unpublish all * use experimental build * change defaults * configuring is optional * call native `RTCAudioSession.setConfiguration` * defaults adjustment * iOS only for now * use lib 92.4515.07 * clean up * revert audio options for now * remove pod source * rename apple related audio * `createListener` method * organize native audio * `SpeakingChangedEvent` only on `Participant` * refactoring * fix ios compile * fix configure audio only for iOS logic * minor fix & clean up * change dispose logic * format protos * fix unpublishTrack * `createListener` into a mixin * simplify * use flutter_webrtc master * unpublish for example * update ios icon * android icon * web icon * favicon
123 lines
3.7 KiB
Dart
123 lines
3.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
extension LKExampleExt on BuildContext {
|
|
//
|
|
Future<bool?> showPublishDialog() => showDialog<bool>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('Publish'),
|
|
content: const Text('Would you like to publish your Camera & Mic ?'),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, false),
|
|
child: const Text('NO'),
|
|
),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: const Text('YES'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
|
|
Future<bool?> showUnPublishDialog() => showDialog<bool>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('UnPublish'),
|
|
content: const Text('Would you like to un-publish your Camera & Mic ?'),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, false),
|
|
child: const Text('NO'),
|
|
),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: const Text('YES'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
|
|
Future<void> showErrorDialog(dynamic exception) => showDialog<void>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('Error'),
|
|
content: Text(exception.toString()),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx),
|
|
child: const Text('OK'),
|
|
)
|
|
],
|
|
),
|
|
);
|
|
|
|
Future<bool?> showDisconnectDialog() => showDialog<bool>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('Disconnect'),
|
|
content: const Text('Are you sure to disconnect?'),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, false),
|
|
child: const Text('Cancel'),
|
|
),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: const Text('Disconnect'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
|
|
Future<bool?> showReconnectDialog() => showDialog<bool>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('Reconnect'),
|
|
content: const Text('This will force a reconnection'),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, false),
|
|
child: const Text('Cancel'),
|
|
),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: const Text('Reconnect'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
|
|
Future<bool?> showSendDataDialog() => showDialog<bool>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('Send data'),
|
|
content: const Text('This will send a sample data to all participants in the room'),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, false),
|
|
child: const Text('Cancel'),
|
|
),
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: const Text('Send'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
|
|
Future<bool?> showDataReceivedDialog(String data) => showDialog<bool>(
|
|
context: this,
|
|
builder: (ctx) => AlertDialog(
|
|
title: const Text('Received data'),
|
|
content: Text(data),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.pop(ctx, true),
|
|
child: const Text('OK'),
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|