media_kit
1.2.6, released 11 months ago by media-kit.dev
Cross‑platform video and audio player for Flutter and Dart
WASM-ready
What it does
Provides a unified Player API that supports video, audio, subtitles, playlists, and hardware acceleration on Android, iOS, web, macOS, Windows, and Linux.
AI-written summary of version 1.2.6, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a single package that handles both video and audio playback
- You require hardware/GPU acceleration and wide format support
- You want to avoid multiple platform‑specific player packages
Skip it when
- You only need simple audio playback
- You prefer a minimal dependency footprint
- You are targeting a single platform and can use a native player
Strengths
- Wide format and codec support
- Hardware/GPU acceleration
- Playlist and track selection features
- Extensible via separate video/audio libraries
Weaknesses
- Requires additional native libraries (media_kit_libs_video/audio)
- Setup complexity for native dependencies
- Large bundle size if both video and audio are used
Setup
- Kind
- Pure Dart
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 11
Add media_kit, media_kit_video, and media_kit_libs_video (or audio) to pubspec. Call MediaKit.ensureInitialized() before runApp. No build_runner needed.
import 'package:media_kit/media_kit.dart';\nimport 'package:media_kit_video/media_kit_video.dart';\n\nvoid main(){\n WidgetsFlutterBinding.ensureInitialized();\n MediaKit.ensureInitialized();\n runApp(const MaterialApp(home: MyScreen()));\n}\n\nclass MyScreen extends StatefulWidget{\n const MyScreen({Key? key}) : super(key:key);\n @override\n State<MyScreen> createState()=>_MyScreenState();\n}\n\nclass _MyScreenState extends State<MyScreen>{\n late final player=Player();\n @override\n void initState(){\n super.initState();\n player.open(const Media('https://example.com/video.mp4'));\n }\n @override\n Widget build(BuildContext context)=>Video(controller: VideoController(player));\n}Alternatives
Packages that do the same job and could replace media_kit.
- video_player
Single package, simpler API, widely used for video playback
93Compare
Works with
Packages commonly used together with media_kit: ones it builds on, ones built on it, and its own family.
- uuidmedia_kit depends on itGenerates and parses RFC‑4122/9562 UUIDs (v1‑v8) for Dart.
- webmedia_kit depends on itLightweight bindings for browser APIs via JS interop
- imagemedia_kit depends on itPure Dart library to load, manipulate, encode, and decode various image formats.
- synchronizedmedia_kit depends on itLock mechanism to prevent concurrent access to asynchronous code.
- universal_platformmedia_kit depends on itPlatform detection across Flutter, Dart web, and desktop without errors
- safe_local_storagemedia_kit depends on itKey-value storage library for Dart/Flutter that safely reads and writes local data.
- media_kit_videoBuilt on media_kitNative implementation for video playback in package:media_kit.
- video_player_media_kitBuilt on media_kitpackage:video_player implementation for all platforms powered by package:media_kit.