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

flutter_to_airplay 封面
插件详情v2.4.0

flutter_to_airplay

Flutter 插件提供两个小部件,一个用于使用原生 AVPlayer 播放给定 URL 或文件路径的视频,另一个则可选择将视频投射到可用的 Apple 设备上。

iOS
近 30 天下载
6970
喜欢数
49
Pub 分数
150

安装插件

flutter pub add flutter_to_airplay

插件介绍

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

一个适用于 iOS 的 Flutter 插件,提供两个小部件,可使用原生 AVPlayer 从 URL 或文件路径播放视频。第二个小部件包含 AirPlay 集成,使用户能够将视频内容流式传输到附近的 Apple 设备(如 Apple TV)。专为 iOS 设计,利用平台特定功能实现流畅的播放和无缝的 AirPlay 支持。非常适合需要高质量视频播放和流媒体选项的媒体应用。

适合场景

  • 在应用程序中从网址流式传输视频
  • 使用 AirPlay 播放本地视频文件
  • 启用屏幕镜像到 Apple TV
  • 在Flutter应用中集成原生视频播放
  • 为iOS构建媒体播放器功能

主要特点

  • 原生 AVPlayer 集成
  • iOS 上的 AirPlay 支持
  • 两个专用的视频播放小部件
  • URL 和文件路径视频源
  • 仅限iOS平台的目标

适合对象

  • iOS 媒体应用
  • 视频流媒体应用
  • 需要 AirPlay 功能的应用程序
  • 针对苹果生态系统的开发者
  • 需要视频播放功能的Flutter项目

使用建议

  • 仅限 iOS – Android 上不可用
  • 需要 iOS 10+ 才能获得完整的 AirPlay 支持
  • 仅限视频播放 – 无音频模式
  • 不支持后台播放
  • 取决于设备的 AirPlay 可用性

原始 README

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

flutter_to_airplay

Flutter plugin that offers two widgets, one to play a video for given url or file path using native AVPlayer and second with an option to airplay it on available Apple devices.

Sponsor/Support

If you like my work, and want to support me so that I can invest more time in improving it, please consider buying me a coffee.

Buy Me A Coffee

Getting Started

This plugin provides two widgets,

1- AirPlayRoutePickerView

Its tintColor, activeTintColor and backgroundColor, can be set to suit the overall theme of application.

AirPlayRoutePickerView(
                tintColor: Colors.white,
                activeTintColor: Colors.white,
                backgroundColor: Colors.transparent,
              )
2- FlutterAVPlayerView

For now it supports either local file added to flutter project, or a video url.

To play a network video for given url:

FlutterAVPlayerView(
              urlString:
                  'https://flutter.github.io/assets-for-api-docs/assets/videos/butterfly.mp4',
            ),

To play a local video added to the flutter project:

child: FlutterAVPlayerView(
              filePath: 'assets/videos/butterfly.mp4',
            ),

Screenshots

Video iPhone Airplay iPhone Video iPad Airplay iPad
iPhoneVideo_Butterfly iPadVideo_Butterfly AirPlayiPhone AirPlayiPad

TODO:

  • [x] Allow videos add to the Flutter project.
  • [ ] Allow videos from more sources, Youtube, etc.

Disclaimers:

  • Please suggest if you want a feature added to this utility
  • Please feel free to add any issues or open PRs, I will be actively looking to add to these utilities.

Credit: Inspired by Package

FlutterAirplayPlugin

所属分类

源码仓库

使用此插件的项目