패키지, 저장소 및 앱 카테고리 검색

패키지 상세v1.30.0

better_player

고급 비디오 플레이어입니다. 많은 일반적인 사용 사례를 해결하고 실행하기 쉽습니다.

30일 다운로드
6.4천
좋아요
1.3천
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 개

소스 저장소

이 패키지를 사용하는 프로젝트