Windows 和 Linux 端依赖 libmpv 引擎,需确认目标环境已具备;Tizen 支持仍为实验性;从 0.0.x 或 better_player_plus 升级到 1.x 需按迁移指南改造 API。
betterplayer
jhomlalaApache-2.0活跃维护Flutter 跨平台视频播放器插件,支持 HLS、DASH、DRM、缓存、画中画和 VAST 广告,适合做短视频流和商业级播放场景。
Production-grade video player for Flutter (Android, iOS, Web, macOS, Windows, Linux) - HLS, DASH, DRM (Widevine & FairPlay), caching, PiP, VAST ads, and vertical video feeds.
flutter pub add better_playerREADME 未说明具体硬件要求;各平台使用系统原生媒体引擎(Android Media3/ExoPlayer、iOS/macOS AVPlayer、Web Shaka/HTML5、Windows/Linux libmpv),未提及显存或 GPU 型号。
Flutter 全平台视频播放器,一个控制器搞定 HLS、DRM、缓存和 PiP
Flutter 跨平台视频播放器插件,支持 HLS、DASH、DRM、缓存、画中画和 VAST 广告,适合做短视频流和商业级播放场景。
核心能力
- 用统一 BetterPlayerController 管理播放与 UI 控制
- 原生支持 HLS/DASH 与 Widevine、FairPlay DRM
- 内置离线缓存、画中画与播放列表
- 支持 SRT、WebVTT、TTML、CEA-608/708 字幕
- 内置 VAST/VMAP 客户端广告引擎与视频流组件
容易踩的坑
- 1.36.0最新正式版2026-11-08 · 2026-11-08 20:34 UTC
better_player_tizen1.0.0
- Added: Initial EXPERIMENTAL release of
better_player_tizenfor Tizen OS and Samsung Smart TVs using the native Tizen Multimedia<player.h>C API. - Added: Capture and upload of Tizen E2E test playback screenshot artifacts in CI/CD workflow.
- Fixed: Added buffering start and end events, seek completion event, User-Agent header forwarding, dynamic video size change notifications, replay after completion, asset data source support, and linked
capi-media-tool.
better_player1.36.0
- Added: Initial EXPERIMENTAL Tizen platform implementation in
packages/better_player_tizen.
- Added: Initial EXPERIMENTAL release of
- 1.35.02026-11-08 · 2026-11-08 13:44 UTC
查看更新说明
better_player_platform_interface1.8.0
- Added:
getAudioTracksmethod toBetterPlayerPlatformto retrieve audio tracks from the native player. - Updated: Updated doc comment for
setSpeedto reflect the new 10.0 limit.
better_player_android1.13.0
- Added:
getAudioTracksimplementation to query audio tracks from Media3trackSelector.currentMappedTrackInfo. - Fixed: Improved
setAudioTrackmatching logic to resolve multi-audio tracks by index and language when container tracks lack explicit labels.
better_player_ios1.13.0
- Added:
getAudioTracksimplementation to query audible options on AVPlayer's current media asset. - Updated: Increased playback speed ceiling from
4.0to10.0insetSpeed.
better_player_macos1.8.0
- Added:
getAudioTracksimplementation to query audible options on AVPlayer's current media asset. - Updated: Increased playback speed ceiling from
4.0to10.0insetSpeed.
better_player_windows1.5.0
- Added:
getAudioTracksimplementation to query container and stream audio tracks from mpvtrack-list. - Updated: Increased playback speed ceiling from
4.0to10.0insetSpeed.
better_player_web1.6.0
- Added:
getAudioTracksimplementation to query audio tracks from Shaka Player variant tracks and audio languages.
better_player1.35.0
- Added:
BetterPlayerController.getAudioTracks()to discover and retrieve audio tracks from both HLS/DASH manifests and native container formats (MKV, MP4, WebM). - Updated: Increased playback speed ceiling from
4.0to10.0acrosssetSpeed(). - Updated: Bumped federated sub-packages:
better_player_platform_interfaceto^1.8.0,better_player_androidto^1.13.0,better_player_iosto^1.13.0,better_player_linuxto^1.1.0,better_player_macosto^1.8.0,better_player_webto^1.6.0, andbetter_player_windowsto^1.5.0.
- Added:
- 1.34.02026-11-08 · 2026-11-08 09:58 UTC
查看更新说明
better_player_android1.12.0
- Updated: Upgraded
androidx.media3to1.11.1,androidx.lifecycleto2.11.0,androidx.annotationto1.11.0, andandroidx.work:work-runtimeto2.12.0. - Updated: Removed legacy unused
androidx.media:mediadependency and imports. - Fixed: Pre-cache worker falsely reporting HTTP errors as completed downloads.
- Fixed: Widevine DRM defaulting to L3 software security level when drmSecurityLevel is not specified.
better_player_ios1.12.0
- [BREAKING_CHANGE] Fixed: Resolved FairPlay key loading thread deadlocks by removing blocking
DispatchSemaphore, madeassetIdstrictly local per request to prevent race conditions, added thread-safe certificate caching with in-flight request deduplication, and scoped EZDRM URL path rewriting to EZDRM domains only. Non-EZDRM license servers now receive standard direct POST requests. - Fixed: CacheManager shared state race condition during concurrent pre-caching and dynamic maxCacheSize updates.
better_player_macos1.7.0
- [BREAKING_CHANGE] Fixed: Resolved FairPlay key loading thread deadlocks by removing blocking
DispatchSemaphore, madeassetIdstrictly local per request to prevent race conditions, added thread-safe certificate caching with in-flight request deduplication, and scoped EZDRM URL path rewriting to EZDRM domains only. Non-EZDRM license servers now receive standard direct POST requests. - Fixed: CacheManager shared state race condition during concurrent pre-caching and dynamic maxCacheSize updates.
better_player_web1.5.0
- Added: ClearKey DRM support on Web via Shaka Player
clearKeys(supporting both standard and Base64Url JWKs and hex keys) andservers['org.w3.clearkey'](for license servers).
better_player1.34.0
- [BREAKING_CHANGE] Updated: Streamlined
BetterPlayerFeedControllercollection and lease methods. ReplacedinsertDataSourceswithinsertAll({required int index, required List<PlayerDataSource> sources, List<String>? ids}), replacedreplaceAtwithreplace({required int index, required PlayerDataSource dataSource, String? id}), replacedgetLeaseNotifier(index)withleaseNotifier(index), and required named parameters oninsert({required int index, required PlayerDataSource dataSource, String? id}). Removed unusedfeedConfigurationconstructor parameter. - [BREAKING_CHANGE] Updated: Removed unused
onProgressparameter fromPlayerEngineController.preCache(all pre-cache events flow throughpreCacheProgressStream). - Added: Playback controls on
BetterPlayerFeedController(play,pause,togglePlay,isPlaying,activeController) and dynamicautoPlayproperty. - Added: Feed navigation helpers (
jumpTo,next,previous) and collection helpers (add,addAll, positionalremoveAt,retrywith default active index) onBetterPlayerFeedController. - Fixed: Wired
PlayerFeedConfiguration.autoPlayto feed playback and addedPlayerFeedConfiguration.copyWith. - Fixed: Resolved byte truncation bug in
BetterPlayerClearKeyUtils.generateKeypreserving leading zero bytes in 16-byte DRM keys. - Fixed: Decoded network subtitles as UTF-8 via response bytes to prevent Latin-1 encoding corruption, and guarded against HTTP error response bodies.
- Fixed: BetterPlayerPool active index protection during slot eviction, failed lease slot reuse, and concurrent bind state tracking.
- Updated: Bumped federated sub-packages:
better_player_androidto^1.12.0,better_player_iosto^1.12.0,better_player_macosto^1.7.0, andbetter_player_webto^1.5.0.
- Updated: Upgraded
- 1.33.02026-11-04 · 2026-11-04 12:45 UTC
查看更新说明
better_player_platform_interface1.7.1
- Updated: Aligned analysis options with root
analysis_options.yamland resolved linter warnings across models and tests.
better_player_android1.11.0
- Updated: Modernized
analysis_options.yamlto inherit root options and resolved static analysis lints.
better_player_ios1.11.1
- Updated: Modernized
analysis_options.yamlto inherit root options and resolved static analysis lints.
better_player_linux1.0.2
- Updated: Modernized
analysis_options.yamlto inherit root options and resolved static analysis lints.
better_player_macos1.6.1
- Updated: Modernized
analysis_options.yamlto inherit root options and resolved static analysis lints.
better_player_windows1.4.2
- Updated: Modernized
analysis_options.yamlto inherit root options and resolved static analysis lints.
better_player_web1.4.1
- Updated: Modernized
analysis_options.yamlto inherit root options and resolved static analysis lints.
better_player1.33.0
- Added: Feed error handling with
PlayerFeedConfiguration.errorBuilder, localizedPlayerFeedErrorView, andBetterPlayerFeedController.retry. - Added: Feed list mutation methods on
BetterPlayerFeedController(insertDataSources,removeAt,replaceAt,replaceAll) with stable item identifiers andPageViewreactivity. - Added: Dynamic slot recycling and index shifting support in
BetterPlayerPoolviareleaseItemandreindex. - Added: Quality of Experience (QoE) telemetry on
BetterPlayerFeedController.metricsStreamtracking time to first frame, preloading state, rebuffering stalls, and errors. - Fixed: Pooled feed slots no longer stay broken after a failed data source setup, with slots recovering cleanly on retry.
- Added: Unit test coverage for
PlayerEngineController,PlayerClosedCaption, and all core controller extensions (PlayerDataSourceExtension,PlayerEventsExtension,PlayerPlaybackExtension,PlayerPlaylistExtension,PlayerSubtitleExtension,PlayerTrackExtension,PlayerTranslationsExtension,PlayerViewStateExtension). - Updated: Replaced legacy
package:flutter/material.dartandcupertino.dartimports withpackage:material_uiandpackage:cupertino_uiacross controls and test suites. - Updated: Aligned
packages/better_playeranalysis options with rootanalysis_options.yaml, enabling strict lint rules includingunawaited_futures,avoid_catches_without_on_clauses, and typed function callbacks while resolving issues across controls, HLS parsing, data sources, and tests. - Updated: Resolved static analysis lints and enabled stricter rules across example app and platform packages.
- Updated: Bumped federated sub-packages:
better_player_platform_interfaceto^1.7.1,better_player_androidto^1.11.0,better_player_iosto^1.11.1,better_player_linuxto^1.0.2,better_player_macosto^1.6.1,better_player_webto^1.4.1, andbetter_player_windowsto^1.4.2.
- Updated: Aligned analysis options with root
- 1.32.02026-11-02 · 2026-11-02 20:28 UTC
查看更新说明
better_player_platform_interface1.7.0
- Added:
showExternalPlaybackPickerandexternalPlaybackStreamtoBetterPlayerPlatformfor native AirPlay, Cast, and Remote Playback routing.
better_player_ios1.11.0
- Added: Native AirPlay route picker (
AVRoutePickerView) andexternalPlaybackActiveKVO state stream. - Updated: Bumped
better_player_platform_interfacedependency to^1.7.0.
better_player_macos1.6.0
- Added: Native AirPlay route picker (
AVRoutePickerView) andexternalPlaybackActiveKVO state stream. - Updated: Bumped
better_player_platform_interfacedependency to^1.7.0.
better_player_web1.4.0
- Added: W3C Remote Playback API and WebKit AirPlay picker support (
showExternalPlaybackPicker) and connection state stream. - Updated: Bumped
better_player_platform_interfacedependency to^1.7.0.
better_player1.32.0
- Added: Native AirPlay and Remote Playback support across iOS, macOS, and Web with top-bar route picker controls,
PlayerControlsConfiguration.enableAirPlay,BetterPlayerController.showAirPlayPicker(),BetterPlayerController.isExternalPlaybackSupported, andPlayerEventType.externalPlaybackChanged. - Added:
PlayerCastExtensioninterface to integrate third-party casting backends without increasing core package size. - Updated: Bumped federated sub-packages:
better_player_platform_interfaceto^1.7.0,better_player_iosto^1.11.0,better_player_macosto^1.6.0, andbetter_player_webto^1.4.0.
- Added:
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Better Player
Why Better Player?
Stop stitching video_player, separate UI packages, abandoned caching plugins, and custom DRM code together. Better Player packs the full video stack into a single, cohesive engine.
| Feature | Better Player | video_player + chewie | media_kit |
|---|---|---|---|
| App Size Overhead | ~1-2 MB (Native OS engines) | ~1-2 MB | +30MB to 50MB (Bundled mpv binaries) |
| Out-of-the-box UI | Built-in & customizable | Chewie required | Built-in |
| HLS / DASH | Full native support | Basic | Native |
| DRM (Widevine / FairPlay) | Native support | None | None |
| Smart Caching | Built-in offline cache | None (3rd party needed) | None |
| Subtitles & Closed Captions | SRT, WebVTT, TTML, CEA-608 / CEA-708 | SRT only | Advanced |
| Picture in Picture (PiP) | Built-in | None | Platform-dependent |
| Playlists | Built-in | None | Built-in |
| VAST / VMAP Ads | Client-side ad engine (VAST 2.0-4.x, VMAP) | None | None |
| Telemetry & QoE | Real-time video metrics, offline retention & cloud export | None | None |
| Watermarking & Screen Shield | Dynamic forensic overlays & native OS screen capture protection | None | None |
| Video Feeds & Pooling | Built-in (BetterPlayerFeed, BetterPlayerPool) | None | None |
| AirPlay & Remote Playback | Native AirPlay (iOS/macOS) & Remote Playback (Web) | None (3rd party needed) | None |
📱 Visual Showcase
📦 Quick Start
1. Install
flutter pub add better_player
2. Basic Playback
Play a network video with full controls in three lines:
import 'package:better_player/better_player.dart';
AspectRatio(
aspectRatio: 16 / 9,
child: BetterPlayer.network(
"https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
),
)
3. Production Playback (Caching, DRM & HLS)
Configure caching, custom headers, or DRM with a single controller:
final controller = BetterPlayerController(
const PlayerConfiguration(
aspectRatio: 16 / 9,
autoPlay: true,
),
betterPlayerDataSource: PlayerDataSource(
DataSourceType.network,
"https://example.com/stream.m3u8",
// Cache video locally for instant playback:
cacheConfiguration: const CacheConfiguration(useCache: true),
// Or protect content with DRM:
drmConfiguration: DrmConfiguration(
drmType: DrmType.widevine,
licenseUrl: "https://license.example.com",
),
),
);
BetterPlayer(controller: controller);
🌐 Platform Packages
Better Player uses a federated architecture. Each platform runs on its native, hardware-accelerated media engine:
🔄 Migration Guides
Switching from another package? Follow the step-by-step migration guides:
- Migrating to 1.x.x (from 0.0.84 and better_player_plus): Upgrade from legacy 0.0.84 or community forks (
better_player_plus,better_player_enhanced) using automateddart fix. - Migrating from video_player: Replace
VideoPlayerControllerand remove separate UI packages. - Migrating from chewie: Consolidate your player and controls into a single controller.
- Migrating from media_kit: Reclaim 30-50 MB of mobile app size and switch to native OS media engines.
🤖 AI Coding Agents
Better Player supports Dart package skills so tools like Cursor, Claude Code, Gemini, and Copilot understand the API out of the box:
dart run skills@ get -p better_player
📖 Resources & Docs
- Official Documentation: Full guides for caching, DRM, subtitles, VAST ads, and playlists.
- Example Application: Complete working samples covering every feature.
- API Reference: Generated Dart doc reference.
🤝 Contributing
Found a bug or missing a feature? Open an issue or submit a pull request.
💼 Enterprise Support
Need a custom video source adapter, bespoke DRM implementation, or tailored UI controls? I am available for consulting.