-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
38 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
## 🚀wlmedia🚀 | ||
#### Android 音视频播放SDK,几句代码即可实现音视频播放功能~ | ||
#### 使用简单,功能丰富,支持手机、车机系统、电视盒子、手表等智能设备 | ||
#### 全新架构,增加稳定性 | ||
#### 使用简单,功能丰富,支持手机、车机系统、电视、电视盒子、手表等智能设备 | ||
#### 全新架构,增强稳定性,性能和系统播放器接近 | ||
#### HarmonyOS Coming Soon | ||
- 若有`HarmonyOS NEXT`开发资质的伙伴,想合作的可以联系:[[email protected]](mailto:[email protected]) | ||
#### iOS Coming Soon | ||
- 内测中... | ||
#### iOS | ||
- 准备中... | ||
## 一 功能&特点 | ||
- [x] 支持系统:Android 4.4+(api 19+) | ||
- [x] 支持架构:armeabi-v7a、arm64-v8a、x86、x86_64 | ||
- [x] 基本信息获取(音频:采样率、声道数、时长等,视频:宽、高、fps、时长等) | ||
- [x] 支持file、http、https、rtmp、rtp、rtsp、byte[]等 | ||
- [x] 支持file、http、https、udp、rtmp、rtp、rtsp、byte[]等几乎所有协议 | ||
- [x] 支持AV1解码 | ||
- [x] 可选音频、视频、音视频播放模式 | ||
- [x] 软解硬解设置 | ||
|
@@ -18,14 +19,15 @@ | |
- [x] 支持播放完成(EOF)后,再次seek又继续播放 | ||
- [x] 支持媒体自由切换 | ||
- [x] 支持FFmpeg参数设置 | ||
- [x] 支持byte[]数据解码 | ||
- [x] 支持byte[]数据类型 | ||
- [x] 音视频加密播放 | ||
- [x] 支持音视频帧解码 | ||
- [x] 支撑音视频变速变调 | ||
- [x] 支撑透明视频播放(可实现不错的视觉效果) | ||
- [x] 字幕选择 | ||
- [x] 内置循环播放 | ||
- [x] 链接超时设置 | ||
- [x] 缓存大小设置(时间维度) | ||
- [x] 音视频加密播放 | ||
- [x] 音轨选择 | ||
- [x] 音频指定采样率设置 | ||
- [x] 音频指定声道播放 | ||
|
@@ -36,7 +38,9 @@ | |
- [x] 视频镜像模式设置 | ||
- [x] 视频背景颜色设置(默认黑色) | ||
- [x] 视频支持同时多个surface渲染(如:KTV大小屏幕) | ||
- [x] 支持Unity播放(需定制对接) | ||
- [x] 支持实时获取音频PCM数据 | ||
- [x] 支持设置音视频同步偏移 | ||
- [x] 支持外部OpenGL渲染(如:Unity、Cocos2d等视频播放) | ||
## 二 集成使用 | ||
### 2.1 gradle [![](https://jitpack.io/v/wanliyang1990/wlmedia.svg)](https://jitpack.io/#wanliyang1990/wlmedia) | ||
```gradle | ||
|
@@ -96,12 +100,12 @@ dependencies { | |
} | ||
|
||
@Override | ||
public void onTimeInfo(double currentTime, double bufferTime) { | ||
public void onTimeInfo(double v, double v1) { | ||
// 时间进度回调 | ||
} | ||
|
||
@Override | ||
public void onComplete(WlCompleteType wlCompleteType, String msg) { | ||
public void onComplete(WlCompleteType wlCompleteType, String s) { | ||
// 播放完成回调,根据 WlCompleteType 区分对应类型 | ||
if (wlCompleteType == WlCompleteType.WL_COMPLETE_EOF) { | ||
// 正常播放完成 | ||
|
@@ -113,13 +117,13 @@ dependencies { | |
// 正在播放中,切换了新的数据源,会回调此类型 | ||
} else if (wlCompleteType == WlCompleteType.WL_COMPLETE_TIMEOUT) { | ||
// 播放超时,会回调此接口 | ||
} else if (wlCompleteType == WlCompleteType.WL_COMPLETE_RELEASE) { | ||
// 播放中调用 wlPlayer.release() 会回调此接口 | ||
} else if (wlCompleteType == WlCompleteType.WL_COMPLETE_LOOP) { | ||
// 循环播放中,每开始新的一次循环,会回调此接口 | ||
} | ||
} | ||
|
||
@Override | ||
public void onLoad(WlLoadStatus wlLoadStatus, int progress, long speed) { | ||
public void onLoad(WlLoadStatus wlLoadStatus, int i, long l) { | ||
// 加载状态回调 | ||
if (wlLoadStatus == WlLoadStatus.WL_LOADING_STATUS_START) { | ||
// 开始加载 | ||
|
@@ -131,46 +135,24 @@ dependencies { | |
} | ||
|
||
@Override | ||
public void onTakePicture(Bitmap bitmap) { | ||
// 截图回调 | ||
} | ||
|
||
@Override | ||
public void onAutoPlay() { | ||
// 如果设置了 wlplayer.setAutoPlay(true) 异步准备好后,将会回调此接口 | ||
public void onSeekFinish() { | ||
// seek 完成回调 | ||
} | ||
|
||
@Override | ||
public void onFirstFrameRendered() { | ||
// 首帧渲染回调 | ||
} | ||
|
||
@Override | ||
public void onSeekFinish() { | ||
// seek 完回调 | ||
} | ||
|
||
@Override | ||
public byte[] decryptBuffer(byte[] encryptBuffer, long position) { | ||
// (子线程)加密视频数据会通过此接口返回,经过解密后再返回给播放器 | ||
return encryptBuffer; | ||
} | ||
|
||
@Override | ||
public byte[] readBuffer(int read_size) { | ||
// (子线程)byte[] 类型的buffer,通过此接口给播放器提供数据 | ||
return null; | ||
} | ||
|
||
@Override | ||
public void onOutRenderInfo(WlOutRenderBean outRenderBean) { | ||
// 供外部渲染获取初始化信息,如 unity播放。 | ||
} | ||
}); | ||
|
||
// 2.获取 WlSurfaceView 并绑定播放器 | ||
WlSurfaceView wlSurfaceView = findViewById(R.id.wlsurfaceview); | ||
wlSurfaceView.setWlPlayer(wlPlayer); | ||
// 可选 | ||
wlSurfaceView.setClearLastVideoFrame(false); // 设置不清屏 | ||
wlSurfaceView.setVideoScale(WlScaleType.WL_SCALE_FIT); // 设置缩放模式 | ||
wlSurfaceView.setVideoRotate(WlRotateType.WL_ROTATE_90); // 设置旋转角度 | ||
wlSurfaceView.setVideoMirror(WlMirrorType.WL_MIRROR_TOP_BOTTOM); // 设置镜像模式 | ||
|
||
// 3.设置数据源异步准备 | ||
wlPlayer.setSource(url); | ||
|
@@ -181,7 +163,7 @@ dependencies { | |
- [1. WlPlayer(音视频播放SDK)](doc/wlplayer_api.md) | ||
- [2. WlMediaUtil(音视频工具类SDK)](doc/wlmediautil_api.md) | ||
- 3.HarmonyOS(coming soon) | ||
- 4.iOS (coming soon) | ||
- 4.iOS (preparing) | ||
## 四 效果展示 | ||
|
||
| 常规播放 | 透明视频 | 多Surface渲染 | 多实例播放 | | ||
|
@@ -197,13 +179,10 @@ dependencies { | |
## 六 免费和增值服务 | ||
`WlMedia` 是按应用根据 `包名` 定制的,分免费版和付费定制版 | ||
### 免费版 | ||
- 免费版需要根据 `包名` 定制打包,功能上包含正常的播放功能。 | ||
- 如需咨询或定制,联系方式: | ||
- 邮箱:[[email protected]](mailto:[email protected]) | ||
- 只有视频画面会带有`wlmedia`水印,其他所有功能不限制!! | ||
|
||
### 增值版 | ||
- demo 默认包名为: `com.ywl5320.wlmedia.example`,要测试功能,把包名改为 `com.ywl5320.wlmedia.example` 即可,无功能限制。 | ||
- 应用包名首次定制打包,`¥29.90` 可试用三个月,每个应用包名仅限一次。 | ||
- 如需咨询或定制,联系方式: | ||
- 如要定制去水印,可付费根据包名定制打包,具体费用和规则请邮件联系: | ||
- 邮箱:[[email protected]](mailto:[email protected]) | ||
|
||
## 七 讨论群(1085618246) | ||
|
@@ -215,5 +194,5 @@ dependencies { | |
- [soundtouch](http://www.surina.net/soundtouch/) | ||
- [dav1d](https://code.videolan.org/videolan/dav1d) | ||
|
||
#### Update By:ywl5320 2024-05-20 | ||
#### Update By:ywl5320 2024-12-15 | ||
#### Create By:ywl5320 2019-12-16 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters