videos_player 0.1.2 copy "videos_player: ^0.1.2" to clipboard
videos_player: ^0.1.2 copied to clipboard

outdated

A flutter package to display list of video with help of chewie and video player

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:videos_player/model/video.model.dart';
import 'package:videos_player/videos_player.dart';
import 'package:videos_player/model/control.model.dart';

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Videos Player'),
    );
  }
}

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

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

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: VideosPlayer(networkVideos: [
        new NetworkVideo(
            id: "1",
            name: "Bee video",
            videoUrl:
                "https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4"),
        new NetworkVideo(
            id: "2",
            name: "Elephant Dream",
            videoUrl:
                "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ElephantsDream.mp4",
            thumbnailUrl:
                "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ElephantsDream.jpg",
            videoControl: new NetworkVideoControl(
              fullScreenByDefault: true,
            )),
        new NetworkVideo(
            id: "3",
            name: "Big Buck Bunny",
            videoUrl:
                "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
            thumbnailUrl:
                "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/BigBuckBunny.jpg",
            videoControl: new NetworkVideoControl(autoPlay: true)),
        new NetworkVideo(
            id: "4",
            name: "For Bigger Blazes",
            videoUrl:
                "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerBlazes.mp4",
            thumbnailUrl:
                "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerBlazes.jpg"),
        new NetworkVideo(
            id: "5",
            name: "For Bigger Escape",
            videoUrl:
                "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerEscapes.mp4",
            thumbnailUrl:
                "http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/images/ForBiggerEscapes.jpg"),
      ]),
    );
  }
}
51
likes
40
pub points
69%
popularity

Publisher

unverified uploader

A flutter package to display list of video with help of chewie and video player

Repository (GitHub)
View/report issues

License

BSD-3-Clause (LICENSE)

Dependencies

chewie, flutter, video_player

More

Packages that depend on videos_player