Better Player 是一個適用於 Flutter 的進階影片播放器,透過簡單直覺的 API 解決常見的影片播放問題。它支援多種串流協定、自適應位元率串流,並提供可自訂的 UI 元件。設計上注重易用性,讓開發者能快速在不同平台實作強大的影片播放功能。此套件文件完整且持續維護,非常適合需要高品質影片體驗的應用程式。
適用情境
串流影片內容
自適應碼率播放
自定義影片 UI
離線影片播放
即時影片串流
主要特色
支援多種影片格式
內建控制項和手勢
可擴展的組件系統
低延遲播放
與HLS和DASH的整合
適合對象
影片密集型應用
教育平台
媒體串流服務
按需影片應用
即時事件直播
使用建議
需要額外設定才能使用進階功能
有限的平台特定自訂
依賴外部依賴項
可能增加應用大小
需要正確處理網路權限
原始 README
以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。
Better Player
Better Player handles the complex video playback edge cases so you don't have to. Originally based on video_player, it's now fully independent. It tackles HLS, DRM, and caching out of the box.
[IMPORTANT] Migrating from 0.0.84 to 1.x.x?
See the Migration Guides section below.
📱 Visual Showcase
Default Controls
Settings Menu
Audio Tracks
Event Listener
🏆 vs Competitors
Why choose Better Player? Here is how it stacks up against the alternatives.
Feature
Better Player
video_player
chewie
media_kit
Engine
ExoPlayer/AVPlayer/Shaka
ExoPlayer/AVPlayer
video_player
libmpv
UI Controls
✅ Built-in & Customizable
❌ None
✅ Built-in
✅ Built-in
HLS / DASH
✅ Native
⚠️ Basic
⚠️ Basic
✅ Native
DRM Support
✅ Widevine/FairPlay/ClearKey
❌ None
❌ None
❌ None
Subtitles
✅ Advanced (WebVTT, HTML, SRT)
⚠️ Basic (SRT only)
⚠️ Basic
✅ Advanced
Caching
✅ Built-in
❌ None
❌ None
❌ None
Playlists
✅ Built-in
❌ None
❌ None
✅ Built-in
🚀 Key Features
Adaptive Streaming: Play HLS, DASH, and Smooth Streaming with automatic track selection.
DRM Support: Protect your content with Widevine, FairPlay, and ClearKey.
Smart Caching: Cache videos for seamless offline playback.
Picture in Picture (PiP): Keep videos playing while users multitask.
Advanced Subtitles: Parse SRT and WebVTT, including HTML tags.
📦 Quick Start
1. Add dependency
Add Better Player to your pubspec.yaml:
dependencies:better_player:^1.10.0
2. Basic Usage
Use the network factory to get a player up and running fast.