yoyo_player 是一个专为 HLS(HTTP 实时流)播放设计的 Flutter 视频播放器包,支持动态画质选择。它允许用户在播放过程中切换不同的视频画质级别,根据网络状况提升流媒体体验。该包以简洁和高性能为目标,可无缝集成到 Flutter 应用中。支持自适应流媒体,并提供简洁的 API 来管理播放控制和画质设置。非常适合需要灵活视频分发的多媒体应用。
适合场景
流式视频质量切换
Flutter 应用中的自适应视频播放
使用 HLS 的实时视频流
按需视频,支持多种分辨率
构建具有用户质量控制的媒体播放器
主要特点
HLS 流媒体支持
动态质量选择
与 Flutter 的简单集成
自适应码率处理
简洁且极简的 API 设计
适合对象
媒体应用
按需视频平台
直播流应用
教育内容传递
需要响应式视频播放的应用程序
使用建议
需要HLS兼容的视频源
仅限iOS和Android(无网页/桌面支持)
无内置 UI 组件
依赖外部HLS流的可用性
可能需要为自定义播放逻辑进行额外配置
原始 README
以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。
YoYo Video Player
YoYo Video Player is a HLS(.m3u8) video player for flutter.
The video_player is a video player that allows you to select HLS video streaming by selecting the quality. YoYo Player wraps video_player under the hood and provides base architecture for developers to create their own set of UI and functionalities.
Features
You can select multiple quality and open
On video tap play/pause, mute/unmute, or perform any action on video.
Auto hide controls.
(.m3u8) HLS Video Streaming Support
Install & Set up
Add dependency, open the root directory pubspec.yamlFile independencies:Add the following code below
yoyo_player:#latest
Installation dependencies (please ignore if it has been installed automatically)
The data in the source url (m3u8) is regex checked and the child m3u8 files are created and saved according to the respective rules.
It starts creating child m3u8 files as soon as the video starts playing
Each time a video is completed or the main url changes, child m3u8 files are checked and deleted.
The child m3u8 files are created as follows:
If viedo quality
yoyo[vido-quality].m3u8
If video quality & audio quality
yoyo[video-quality][audio-quality].m3u8
Support M3U8
#EXT-X-MEDIA
#EXT-X-STREAM-INF(not for ios)
Player Screenshot
Contributors
Min Si Thu
Ko Htut
MIT License
Copyright (c) 2020 Ko Htut (Ko Min Than Htut)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.