mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-04 04:04:18 +00:00 
			
		
		
		
	Can interrupt local streaming
This commit is contained in:
		@@ -20,6 +20,8 @@ import 'package:flutter_webrtc/webrtc.dart';
 | 
				
			|||||||
///
 | 
					///
 | 
				
			||||||
/// @author Pierre Hubert
 | 
					/// @author Pierre Hubert
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					enum _PopupMenuOption { STOP_STREAMING }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class CallScreen extends StatefulWidget {
 | 
					class CallScreen extends StatefulWidget {
 | 
				
			||||||
  final int convID;
 | 
					  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
 | 
					  @override
 | 
				
			||||||
  Widget build(BuildContext context) {
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
    return Scaffold(
 | 
					    return Scaffold(
 | 
				
			||||||
@@ -473,6 +484,20 @@ class _CallScreenState extends SafeState<CallScreen> {
 | 
				
			|||||||
                : Icons.videocam_off),
 | 
					                : Icons.videocam_off),
 | 
				
			||||||
            onPressed: () => _toggleStreaming(true),
 | 
					            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),
 | 
				
			||||||
 | 
					            ),
 | 
				
			||||||
 | 
					          )
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
      ),
 | 
					      ),
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user