web_video_player 0.0.1-dev.2 copy "web_video_player: ^0.0.1-dev.2" to clipboard
web_video_player: ^0.0.1-dev.2 copied to clipboard

A Flutter Web Video Player

example/main.dart

import 'package:flutter/material.dart';
import 'package:web_video_player/player.dart';

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Web Video Player',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: const MyHome(),
    );
  }
}

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

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text('Web Video Player'),
      ),
      body: const Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            WebVideoPlayer(
              url:
                  'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4',
              autoPlay: true,
            ),
          ],
        ),
      ),
    );
  }
}