Skip to main content

voxera_media_client 1.6.2 copy "voxera_media_client: ^1.6.2" to clipboard
voxera_media_client: ^1.6.2 copied to clipboard

Voxera Media Client — real-time audio and video for Flutter (iOS, Android, Web).

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:voxera_media_example/theme.dart';
import 'package:logging/logging.dart';
import 'package:intl/intl.dart';
import 'pages/connect.dart';

void main() async {
  final format = DateFormat('HH:mm:ss');
  // configure logs for debugging
  Logger.root.level = Level.FINEST;
  Logger.root.onRecord.listen((record) {
    print('${format.format(record.time)} [${record.level.name}]: ${record.message}');
  });

  WidgetsFlutterBinding.ensureInitialized();
  /*if (lkPlatformIsDesktop()) {
    await FlutterWindowClose.setWindowShouldCloseHandler(() async {
      await onWindowShouldClose?.call();
      return true;
    });
  }*/

  /// for livestreaming app, you can initialize the bypassVoiceProcessing = true
  /// here to get better audio quality
  ///
  /// await VoxeraMediaClient.initialize(
  ///  bypassVoiceProcessing: lkPlatformIsMobile(),
  /// );
  runApp(const VoxeraMediaExampleApp());
}

class VoxeraMediaExampleApp extends StatelessWidget {
  //
  const VoxeraMediaExampleApp({
    super.key,
  });

  @override
  Widget build(BuildContext context) => MaterialApp(
        title: 'Voxera Media Flutter Example',
        theme: VoxeraMediaTheme().buildThemeData(context),
        home: const ConnectPage(),
      );
}