パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v1.30.0

better_player

高度な動画プレーヤー。多くの一般的なユースケースを解決し、実行も簡単です。

30日間ダウンロード
6420
いいね数
1310
Pub ポイント
160

パッケージをインストール

flutter pub add better_player

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Better Player は、Flutter向けの高度なビデオプレーヤーであり、一般的な動画再生の課題をシンプルで直感的なAPIで解決します。さまざまなストリーミングプロトコル、アダプティブビットレートストリーミングをサポートし、カスタマイズ可能なUIコンポーネントを提供します。使いやすさを重視した設計により、開発者は異なるプラットフォームで堅牢な動画再生機能を迅速に実装できます。ドキュメントが充実しており、継続的にメンテナンスされているため、高品質な動画体験を必要とするアプリに最適です。

用途

  • ストリーミング動画コンテンツ
  • アダプティブビットレート再生
  • カスタム動画 UI
  • オフライン動画再生
  • ライブ動画ストリーミング

主な機能

  • 複数の動画形式のサポート
  • 組み込みコントロールとジェスチャー
  • 拡張可能なウィジェットシステム
  • 低遅延再生
  • HLSおよびDASHとの統合

適している対象

  • 動画中心のアプリケーション
  • 教育プラットフォーム
  • メディアストリーミングサービス
  • オンデマンド動画アプリ
  • ライブイベント放送

注意事項

  • 高度な機能を利用するには追加の設定が必要です
  • 制限されたプラットフォーム固有のカスタマイズ
  • 外部の依存関係に依存しています
  • アプリのサイズが増加する可能性があります
  • ネットワーク権限の適切な処理が必要です

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Better Player

pub package pub package pub package

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.

import 'package:better_player/better_player.dart';

// Inside your build method
AspectRatio(
  aspectRatio: 16 / 9,
  child: BetterPlayer.network(
    "https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4",
    betterPlayerConfiguration: PlayerConfiguration(
      aspectRatio: 16 / 9,
      looping: true,
      autoPlay: true,
    ),
  ),
)
3. Advanced Controller Usage

Need full control? Initialize a BetterPlayerController manually.

BetterPlayerController _controller = BetterPlayerController(
    const PlayerConfiguration(),
    betterPlayerDataSource: PlayerDataSource(
        DataSourceType.network,
        "https://example.com/video.mp4",
    ),
);

BetterPlayer(controller: _controller)

🤖 AI Agent Quick Reference

Writing a script or prompt? Feed this to your AI to get the right code on the first try.

  • Initialization: Always initialize BetterPlayerController in initState() with a PlayerConfiguration and PlayerDataSource.
  • Core Classes:
    • BetterPlayerController: Manages state and configuration.
    • PlayerDataSource: Wraps video URL, DRM config, subtitles, headers.
    • PlayerConfiguration: UI, looping, autoPlay, aspect ratio.
    • PlayerControlsConfiguration: Colors, icons, padding for the control bar.
  • Subtitles: Pass PlayerSubtitlesSource directly into PlayerDataSource.
  • Disposal: Default is autoDispose: true. Avoid manual controller.dispose() unless you opt out.

🔄 Migration Guides

Moving from another package? Follow these guides:


📖 Resources


🤝 Contributing

Bugs? Feature requests? Open an issue. Better yet, submit a PR.

💼 Enterprise Support

Need a custom video source adapter, bespoke DRM implementation, or tailored UI controls? I'm available for consulting.

Let's talk on LinkedIn →

カテゴリー

依存関係

依存関係一覧 17 件

ソースリポジトリ

このパッケージを使用しているプロジェクト