Appearance
Overview
- File:
lib/views/call_page.dart
The call_page.dart file implements the video call interface for the HVC XR application. It provides a comprehensive video conferencing experience with features like camera controls, audio management, chat functionality, and device-specific optimizations for RealWear devices.
Class Structure
dart
class CallPage extends StatefulWidget {
static const String routeName = '/MeetingPage';
final CallDetails callDetails;
final bool isEventOwner;
final bool isGuest;
final bool isRapidConnect;
}
class _CallPageState extends State<CallPage> with WidgetsBindingObserver {
// State implementation
}Dependencies
dart:async- For asynchronous operationsdart:core- Core Dart functionalitydart:io- Platform-specific functionalityflutter/material.dart- Flutter UI componentsget/get.dart- State managementhippo_web_rtc- WebRTC implementationonesignal_flutter- Push notificationsuuid- Unique identifier generationwakelock- Screen wake lock management
Key Components
State Variables
_localVideoRenderer- Renders local video stream_remoteVideoRenderer- Renders remote video stream_sessionId- Unique session identifier_sessionDate- Session timestampavailableList- List of available participantschatOptions- Chat configuration optionsimageUrl- URL for shared imagestimeString- Call duration display
Controllers
pexipController- Manages Pexip video call functionalitymediaController- Handles media operationsmeetingsController- Manages meeting statemessagesController- Handles chat messagescontactsController- Manages contact informationeventsController- Handles event-related operationsrealTimeController- Manages real-time communicationauthController- Handles authenticationdigilensController- Manages DigiLens-specific features
Core Functionality
Video Call Management
dart
void _handleStartCall() async {
await pexipController.start();
realTimeController.sendState('call');
}Camera Controls
- Camera switching
- Zoom control
- Torch control
- Laser pointer (device-specific)
- Exposure adjustment
Audio Management
dart
Future<void> _audioAndSpeaker(bool onOrOff) async {
await pexipController.setAudioOnOrOff(onOrOff);
await _changeSpeakerState(onOrOff);
}Device Information
dart
Future<void> updateDeviceInfoOnServer() async {
final deviceInfo = HeadsetDeviceInfo(
contactName: user.name,
deviceName: deviceId,
deviceType: deviceType,
// ... other device information
);
await realTimeController.callDeviceStatus(deviceInfo);
}Remote Control Handling
dart
void _handleRemoteControl(RemoteControlResponse remoteControl) async {
// Handles various remote control actions:
// - Exposure adjustment
// - Photo capture
// - Zoom control
// - Torch control
// - Laser control
// - Camera switching
}UI Components
Main Layout
- Video display area
- Control buttons
- Participant list
- Chat window
- Device controls
Control Buttons
- Audio mute/unmute
- Video on/off
- Camera switch
- Zoom control
- Remote control
- View switch
- Participant view
- Chat toggle
- More options
Voice Commands
dart
void registerCallCommands() {
voiceCommandMap['participants'] = () => handleParticipantsAndMainView();
voiceCommandMap['mainView'] = () => handleParticipantsAndMainView();
voiceCommandMap['zoom'] = () => handleZoom();
// ... other voice commands
}Device-Specific Features
Navigator-500 Support
- Optimized camera controls
- Enhanced zoom functionality
- Improved audio handling
- Better performance
DigiLens Support
- Specialized UI adaptations
- Custom control layouts
- Optimized performance
State Management
- Uses GetX for reactive state management
- Manages call state, participant list, and UI controls
- Handles device-specific state changes
Error Handling
dart
void handleException(e) {
logInfo('Error: $e');
// Error handling implementation
}Dependencies
get- State managementhippo_web_rtc- WebRTC implementationonesignal_flutter- Push notificationspermission_handler- Permission managementuuid- ID generationwakelock- Screen wake lock
Styling
- Follow application theme
- Use consistent button styles
- Implement responsive layouts
- Handle different screen sizes
- Support dark/light modes