bccm_player 1.0.3 copy "bccm_player: ^1.0.3" to clipboard
bccm_player: ^1.0.3 copied to clipboard

discontinued

ExoPlayer/AVPlayer via platform views, with cast, PiP, background audio, audio selection, etc.

example/lib/main.dart

import 'package:bccm_player/bccm_player.dart';
import 'package:bccm_player_example/examples/custom_controls.dart';
import 'package:bccm_player_example/examples/simple_player.dart';
import 'package:flutter/material.dart';

import 'examples/list_of_players.dart';
import 'examples/playground.dart';

Future main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await BccmPlayerInterface.instance.setup();
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return DefaultTabController(
      length: 4,
      child: MaterialApp(
        home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
            actions: const [
              Padding(
                padding: EdgeInsets.only(right: 16),
                child: CastButton(color: Colors.white),
              ),
            ],
            bottom: const TabBar(tabs: [
              Tab(text: 'Playground'),
              Tab(text: 'List Of Players'),
              Tab(text: 'Single player'),
              Tab(text: 'Custom controls'),
            ]),
          ),
          // tabs with Playground #1 then a new "ListOfPlayers" tab at #2 and controls to navigate between the tabs
          body: const TabBarView(
            children: [
              Playground(),
              ListOfPlayers(),
              SimplePlayer(),
              CustomControls(),
            ],
          ),
        ),
      ),
    );
  }
}