cached_video_player_plus 1.0.1 copy "cached_video_player_plus: ^1.0.1" to clipboard
cached_video_player_plus: ^1.0.1 copied to clipboard

Original video_player plugin with the superpower of caching embedded in Android and iOS.

example/lib/main.dart

// Flutter Packages
import 'package:flutter/material.dart';

// This Package
import 'package:cached_video_player_plus/cached_video_player_plus.dart';

void main() {
  runApp(const MyApp());
}

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Cached Video Player Plus Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Cached Video Player Plus Example'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});

  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  late CachedVideoPlayerPlusController controller;

  @override
  void initState() {
    super.initState();
    controller = CachedVideoPlayerPlusController.network(
      "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
    )..initialize().then((value) {
        controller.play();
        setState(() {});
      });
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: controller.value.isInitialized
            ? AspectRatio(
                aspectRatio: controller.value.aspectRatio,
                child: CachedVideoPlayerPlus(controller),
              )
            : const CircularProgressIndicator(),
      ),
    );
  }
}
58
likes
150
pub points
96%
popularity

Publisher

verified publisheroutdatedguy.rocks

Original video_player plugin with the superpower of caching embedded in Android and iOS.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter, video_player_platform_interface, video_player_web

More

Packages that depend on cached_video_player_plus