mirror of
https://gitlab.com/comunic/comunicmobile
synced 2024-11-22 21:09:21 +00:00
Can interrupt local streaming
This commit is contained in:
parent
e5ccedd180
commit
8609e4e169
@ -20,6 +20,8 @@ import 'package:flutter_webrtc/webrtc.dart';
|
||||
///
|
||||
/// @author Pierre Hubert
|
||||
|
||||
enum _PopupMenuOption { STOP_STREAMING }
|
||||
|
||||
class CallScreen extends StatefulWidget {
|
||||
final int convID;
|
||||
|
||||
@ -345,6 +347,15 @@ class _CallScreenState extends SafeState<CallScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
/// Handles menu selection
|
||||
void _handleSelectedMenuOption(_PopupMenuOption option) {
|
||||
switch (option) {
|
||||
case _PopupMenuOption.STOP_STREAMING:
|
||||
_stopStreaming();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -473,6 +484,20 @@ class _CallScreenState extends SafeState<CallScreen> {
|
||||
: Icons.videocam_off),
|
||||
onPressed: () => _toggleStreaming(true),
|
||||
),
|
||||
|
||||
// Interrupt local streaming
|
||||
Expanded(
|
||||
child: PopupMenuButton<_PopupMenuOption>(
|
||||
itemBuilder: (c) => [
|
||||
// Interrupt streaming
|
||||
PopupMenuItem(
|
||||
child: Text(tr("Stop streaming")),
|
||||
value: _PopupMenuOption.STOP_STREAMING)
|
||||
],
|
||||
icon: Icon(Icons.menu),
|
||||
onSelected: (d) => _handleSelectedMenuOption(d),
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user