OrangePlayer:功能完整的 Android 视频播放器开源库
前言
最近在开发一个视频播放相关的项目,需要实现弹幕、字幕、OCR 识别等功能。调研了市面上的开源播放器库后,发现虽然 GSYVideoPlayer 很强大,但要实现这些功能还需要大量的二次开发。于是我基于 GSYVideoPlayer 开发了 OrangePlayer,将这些常用功能都封装好了,开箱即用。
项目介绍
GitHub 地址:https://github.com/706412584/orangeplayer
主要特性:
- 🎬 多播放内核:支持系统/ExoPlayer/IJK/阿里云,可运行时切换
- 📝 字幕系统:支持 SRT/ASS/VTT 格式,大小可调
- 🔤 OCR 识别:使用 Tesseract 识别硬字幕 + ML Kit 翻译
- 🎤 语音识别:Vosk 离线语音识别,实时生成字幕
- 💬 弹幕功能:大小/速度/透明度可调,支持发送
- 🎛️ 倍速播放:0.35x - 10x,支持长按倍速
- ⏰ 定时关闭:30/60/90/120 分钟
- ⏭️ 跳过片头尾:0-300 秒可调
- 📺 投屏功能:DLNA 投屏支持
- 🖼️ 画中画:PiP 小窗模式
快速开始
1. 添加依赖
dependencies {
// OrangePlayer 核心库
implementation 'com.github.706412584:orangeplayer:v1.0.5'
// GSY 基础依赖(必需)
implementation 'io.github.carguo:gsyvideoplayer-java:11.3.0'
// ExoPlayer 播放内核(推荐)
implementation 'io.github.carguo:gsyvideoplayer-exo2:11.3.0'
}
2. 布局文件
<com.orange.playerlibrary.OrangevideoView
android:id="@+id/video_player"
android:layout_width="match_parent"
android:layout_height="200dp"/>
3. 代码使用
OrangevideoView mVideoView = findViewById(R.id.video_player);
// 设置视频地址和标题
mVideoView.setUp("https://example.com/video.mp4", true, "示例视频");
mVideoView.startPlayLogic();


