video_box 0.15.6 copy "video_box: ^0.15.6" to clipboard
video_box: ^0.15.6 copied to clipboard

outdated

A control that plays video in flutter, I make the control as flexible as possible, can play a single video, video list on the page.

example/lib/main.dart

import 'package:flutter/material.dart';
import 'pages/video_player_demo.dart';
import 'pages/videos.dart';
import 'pages/change_video_src.dart';
import 'pages/list_video.dart';
import 'pages/one_video_ctrl.dart';
// import 'pages/pip.dart';

const oneVideoCtrl = '/one-video-ctrl';
const listVideo = '/list-video';
const changeVideoSrc = '/change-video-src';
const videos = '/videos';
const videoPlayerDemo = '/video-player-demo';
const pipDemo = '/pip-demo';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      routes: <String, WidgetBuilder>{
        oneVideoCtrl: (BuildContext context) => OneVideoCtrl(),
        listVideo: (BuildContext context) => ListVideo(),
        changeVideoSrc: (BuildContext context) => ChangeVideoSrc(),
        videos: (BuildContext context) => Videos(),
        videoPlayerDemo: (BuildContext context) => VideoPlayerDemo(),
        // pipDemo: (BuildContext context) => PipPage(),
      },
      home: HomePage(),
    );
  }
}

class HomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    void _push(String url) {
      Navigator.of(context).pushNamed(url);
    }

    return Scaffold(
      appBar: AppBar(title: Text('video_box example')),
      body: Center(
        child: IntrinsicWidth(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: <Widget>[
              ElevatedButton(
                child: Text('one video ctrl'),
                onPressed: () => _push(oneVideoCtrl),
              ),
              ElevatedButton(
                child: Text('list video'),
                onPressed: () => _push(listVideo),
              ),
              ElevatedButton(
                child: Text('change video src'),
                onPressed: () => _push(changeVideoSrc),
              ),
              ElevatedButton(
                child: Text('videos'),
                onPressed: () => _push(videos),
              ),
              ElevatedButton(
                child: Text('VideoPlayerDemo'),
                onPressed: () => _push(videoPlayerDemo),
              ),
              ElevatedButton(
                child: Text('PiP'),
                onPressed: () => _push(pipDemo),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
23
likes
0
pub points
78%
popularity

Publisher

verified publisherajanuw.lol

A control that plays video in flutter, I make the control as flexible as possible, can play a single video, video list on the page.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

connectivity, dart_printf, flutter, flutter_mobx, mobx, sensors, video_player

More

Packages that depend on video_box