搜索插件、代码仓与 APP 分类

flutter_playout 封面
插件详情v2.0.1

flutter_playout

该插件支持从 URL 播放音频/视频,具备后台音频播放支持、锁屏控制以及 iOS 和 Android 的播放器事件。

AndroidiOS
近 30 天下载
165
喜欢数
234
Pub 分数
140

安装插件

flutter pub add flutter_playout

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

flutter_playout 是一个 Flutter 插件,支持从 URL 播放音频和视频,并具备强大的后台音频支持、锁屏控制以及在 Android 和 iOS 上的实时播放器事件处理。专为流媒体应用设计,即使应用程序被最小化或设备锁定,也能确保无缝的媒体播放。该插件与 Flutter 生态系统无缝集成,为直播和点播内容提供可靠的性能。特别适用于广播应用、视频点播平台以及任何需要持续媒体播放的应用程序。

适合场景

  • 实时广播流
  • 按需视频播放
  • 播客背景音频
  • 带有锁屏控制的媒体应用
  • 跨平台媒体播放器

主要特点

  • 背景音频播放
  • 锁屏控制
  • 实时玩家事件
  • 跨平台(iOS 和 Android)
  • 基于URL的媒体源支持

适合对象

  • 流媒体应用
  • 音频/视频播放器
  • 播客应用
  • 媒体丰富的 Flutter 应用
  • 需要持续播放的应用

使用建议

  • 需要平台特定的设置
  • 仅限基于URL的来源
  • 可能需要额外的权限才能在后台播放音频
  • 依赖于底层原生媒体框架
  • 未经定制,不适用于本地文件播放

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

AVPlayer for Flutter

pub package

Audio & Video player in Flutter. This plugin provides audio/video playback with background audio support, text tracks and lock screen controls for both iOS & Android. It also provides player events such as onPlay, onPause, onTime etc. See example for more details.

  • Video supports HLS and Progressive Steaming for both iOS & Android with multi-audio support.

  • Audio supports playback from URL only.

Apps Using flutter_playout

See below for example of apps using flutter_playout.

  1. MTA International (iOS - Android)

Send a pull request to list your app here.

iOS Example
screenshot1 screenshot4 screenshot3
Android Example
screenshot5 screenshot6

Getting Started

Android

Uses ExoPlayer with PlatformView for Video playback and MediaPlayer for audio playback.

When using this plugin, please make sure you have included a notification icon for your project in drawable resource directory named ic_notification_icon. This plugin will use this icon to show lock screen controls for playback.

iOS

Uses AVPlayer with PlatformView for video playback and AVPlayer with Flutter MethodChannels for audio playback.

Please make sure you've enabled background audio capability for your project. Please also note that the player might not function properly on a simulator.

Opt-in to the embedded views preview by adding a boolean property to the app's Info.plist file with the key io.flutter.embedded_views_preview and the value YES.

HLS MultiAudio Support

Please see example app on how to implement multi-audio for Android. On iOS multi-audio is provided natively by the AVPlayer.

Text Tracks Support

To display subtitles, pass in an array of TextTrack sources to the Video widget. You can select a track by providing preferredTextLanguage to the Video widget with a language ISO code for example en or fr. This setup only applies to Android. For iOS please embed text tracks in the HLS manifest.

所属分类

源码仓库

使用此插件的项目

暂无相关数据。