cached_video_player 1.0.2 copy "cached_video_player: ^1.0.2" to clipboard
cached_video_player: ^1.0.2 copied to clipboard

outdated

A new flutter plugin that is virtually a clone of official video_player plugin except that it supports caching( Android for now)

example/lib/main.dart

import 'package:cached_video_player/cached_video_player.dart';
import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);
  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  CachedVideoPlayerController controller;
  @override
  void initState() {
    controller = CachedVideoPlayerController.network(
        "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4");
    controller.initialize().then((_) {
      setState(() {});
      controller.play();
    });
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
          child: controller.value != null && controller.value.initialized
              ? AspectRatio(
                  child: CachedVideoPlayer(controller),
                  aspectRatio: controller.value.aspectRatio,
                )
              : Center(
                  child: CircularProgressIndicator(),
                )),
    );
  }
}
220
likes
0
pub points
95%
popularity

Publisher

verified publisherlazyarts.in

A new flutter plugin that is virtually a clone of official video_player plugin except that it supports caching( Android for now)

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on cached_video_player