media_kit_video 0.0.11 copy "media_kit_video: ^0.0.11" to clipboard
media_kit_video: ^0.0.11 copied to clipboard

Native implementation for video playback in package:media_kit.

example/README.md

import 'package:flutter/material.dart';

import 'package:media_kit/media_kit.dart';                        /// Provides [Player], [Media], [Playlist] etc.
import 'package:media_kit_video/media_kit_video.dart';            /// Provides [VideoController] & [Video] etc.

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  MediaKit.ensureInitialized();
  runApp(
    const MaterialApp(
      home: MyScreen(),
    ),
  );
}

class MyScreen extends StatefulWidget {
  const MyScreen({Key? key}) : super(key: key);
  @override
  State<MyScreen> createState() => MyScreenState();
}

class MyScreenState extends State<MyScreen> {
  late final player = Player();
  late final controller = VideoController(player);

  @override
  void initState() {
    super.initState();
    player.open(Media('https://user-images.githubusercontent.com/28951144/229373695-22f88f13-d18f-4288-9bf1-c3e078d83722.mp4'));
  }

  @override
  void dispose() {
    player.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Video(
        controller: controller,
      ),
    );
  }
}
20
likes
0
pub points
98%
popularity

Publisher

verified publishermedia-kit.dev

Native implementation for video playback in package:media_kit.

Repository (GitHub)
View/report issues

Funding

Consider supporting this project:

www.github.com

License

unknown (license)

Dependencies

ffi, flutter, media_kit, plugin_platform_interface, synchronized

More

Packages that depend on media_kit_video