支持 IJKPlayer 、 Media3(EXOPlayer2) 、MediaPlayer、AliPlayer,??了多功能的??播放器。 (?仔???下方各??明,大多???可在下方?到解答)。 ?蒙版本 openharmony-tpc/GSYVideoPlayer 如果克隆太慢或者?片看不到,可????云地址下? ?型 功能 ?存 ?播??存,使用了 AndroidVideoCache ;Media3(ExoPlayer)使用SimpleCache。 ?? h263\4\5、Https、concat、rtsp、hls、rtmp、crypto、mpeg等等。 (ijk模式格式支持) ?? ????(??克、黑白、色彩??、高斯、模糊、模糊等等20多?)、??、(水印、?面多重播放等)。 ?? ??第一?、???截?功能,??生成gif功能。 播放 列表播放、列表??播放、重力旋??手?旋?、??本身rotation旋??性、快播和慢播、????加?速度。 ?面 ?整?示比例:默?、16:9、4:3、?充;播放?旋??面角度(0,90,180,270);?像旋?。 ?核 IJKPlayer、Media3(EXOPlayer)、MediaPlayer、AliPlayer切?、自定??核 布局 全??非全??套布局切?、?有任何操作控件的?播放支持、?幕功能、?承自定?任何布局。 播放 ?例播放、多?同?播放、??列表滑?自?播放、列表切??情?面无?播放。 ?口 小?口、多??下(包括?面)的小?口播放。 ?告 片??告、跳??告支持、中??入?告功能。 字幕 media3(exo2)模式下支持自定增加外?字幕 。 dash media3(exo2) 模式支持dash stream 支持元?据播放 更多 ?停前后台切?不黑?;?整不同??度的支持;无?切?支持;?定/解?全?点?功能;?度?小?口??(??)。 自定? 可自定?渲染?、自定?管理?、自定?播放?(控制?)、自定??存?。 公?? 掘金 知乎 CSDN ?? GSYTech 点我 点我 点我 点我 --------------Demo APK 下?地址--------------- 一、使用依? --- 版本更新?明 --- 。 1、Jitpack 引入方法(推?, JCenter ????) First、在project下的build.gradle添加 allprojects { repositories { ... maven { url 'https://jitpack.io' } maven { url "https://maven.aliyun.com/repository/public" } } } ?可以??下面三?的其中一?,在module下的build.gradle添加。 A、直接引入 //完整版引入 implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v8.6.0-release-jitpack' //是否需要AliPlayer模式 implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-aliplay:v8.6.0-release-jitpack' B、添加java和?想要的so支持: implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.6.0-release-jitpack' //是否需要ExoPlayer模式 implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-exo2:v8.6.0-release-jitpack' //是否需要AliPlayer模式 implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-aliplay:v8.6.0-release-jitpack' //根据?的需求ijk模式的so implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-arm64:v8.6.0-release-jitpack' implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv7a:v8.6.0-release-jitpack' implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv5:v8.6.0-release-jitpack' implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x86:v8.6.0-release-jitpack' implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x64:v8.6.0-release-jitpack' C、支持其他格式??的(mpeg,rtsp, concat、crypto??) A、B普通版本支持263/264/265等,?于mpeg???有?音无?面情?。 C 引入的so支持mpeg??和其他?充??,但是so包相??大。 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v8.6.0-release-jitpack' //是否需要ExoPlayer模式 implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-exo2:v8.6.0-release-jitpack' //是否需要AliPlayer模式 implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-aliplay:v8.6.0-release-jitpack' //更多ijk的??支持 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:v8.6.0-release-jitpack' 代?中的全局切?支持(更多??看下方文?和demo) //EXOPlayer?核,支持格式更多 PlayerFactory.setPlayManager(Exo2PlayerManager.class); //系??核模式 PlayerFactory.setPlayManager(SystemPlayerManager.class); //ijk?核,默?模式 PlayerFactory.setPlayManager(IjkPlayerManager.class); //aliplay ?核,默?模式 PlayerFactory.setPlayManager(AliPlayerManager.class); //exo?存模式,支持m3u8,只支持exo CacheFactory.setCacheManager(ExoPlayerCacheManager.class); //代理?存模式,支持所有模式,不支持m3u8等,默? CacheFactory.setCacheManager(ProxyCacheManager.class); //切?渲染模式 GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL); //默??示比例 GSYVideoType.SCREEN_TYPE_DEFAULT = 0; //16:9 GSYVideoType.SCREEN_TYPE_16_9 = 1; //4:3 GSYVideoType.SCREEN_TYPE_4_3 = 2; //全?裁??示,?了?示正常 CoverImageView 建?使用FrameLayout作?父布局 GSYVideoType.SCREEN_TYPE_FULL = 4; //全?拉伸?示,使用???性?,surface_container建?使用FrameLayout GSYVideoType.SCREEN_MATCH_FULL = -4; /*** * SCREEN_TYPE_CUSTOM 下自定??示比例 * @param screenScaleRatio 高?比,如 16:9 */ public static void setScreenScaleRatio(float screenScaleRatio) //切??制模式 GSYVideoType.setRenderType(GSYVideoType.SUFRACE); GSYVideoType.setRenderType(GSYVideoType.GLSURFACE); GSYVideoType.setRenderType(GSYVideoType.TEXTURE); //ijk??log IjkPlayerManager.setLogLevel(IjkMediaPlayer.IJK_LOG_SILENT); //exoplayer自定?MediaSource ExoSourceManager.setExoMediaSourceInterceptListener(new ExoMediaSourceInterceptListener() { @Override public MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir) { //可自定?MediaSource return null; } }); --- 更多依?方式?点? - 二、其他推? * 我所在的技?社?: 掘金 * QQ群,有?趣的?迎(平?吹水吐槽多,因?人??和,就是日常??,?人解???的):174815284 。 * Flutter Github客?端 、 React Native Github客?端 、 Weex Github客?端 、 原生 Kotlin Github客?端 * RxFFmpeg Android 的音????工具 * oarplayer Rtmp播放器,基于MediaCodec?srs-librtmp,不依?ffmpeg * ?蒙版本 openharmony-tpc/GSYVideoPlayer 三、文?Wiki 文? ?送? 使用?明 --- ??使用,快速上手文? 建??? --- 移???者必知的音??基?知?1 、 --- 移???者必知的音??基?知?2 ?目解析?明 --- ?目解析?明、包含?目架?和解析 接口文?入口 --- 使用?明、接口文? - 入口 ??集?入口 --- ??集? - 入口(大部分?遇到的??都在?里解?) ??格式 --- IJK so文件配置格式?明 ??自定?SO --- IJKPlayer??自定?SO - 入口 版本更新?明 --- 版本更新?明 - 入口 compileSdk 太高 --- #3514 四、?行效果 1、打?一?播放(旋?、?像、?充) 2、列表/?情模式(??、旋?、小??) 3、?幕 4、??和GL?? 6、背景??模糊播放 7、?度?小?口?? 五、近期版本 v8.6.0-release-jitpack (2024-03-07) update media 1.3.0 update exo source intercept listener fix #3900 v8.5.0-release-jitpack (2023-11-20) update media 1.2.0 & compileSdk 34 update exoplayer to androidx media fix #3874 fix issues 3855 (#3856) add #3843 v8.4.0-release-jitpack (2023-07-17) update exoplayer to androidx media fix #3824 with ExoPlaybackException update aliyun sdk version fix AGP8 support exoplayer file sink fix #3798 更多版本???: 版本更新?明 六、?于Issues 提??前可先??上方文?和?明,?在Demo中????。 ???明: 1、?明那?Demo中???面。 2、????和重?步?。 3、?充??的??流url,截?。 4、?充??的机型,android版本。 七、混淆 -keep class com.shuyu.gsyvideoplayer.video.** { *; } -dontwarn com.shuyu.gsyvideoplayer.video.** -keep class com.shuyu.gsyvideoplayer.video.base.** { *; } -dontwarn com.shuyu.gsyvideoplayer.video.base.** -keep class com.shuyu.gsyvideoplayer.utils.** { *; } -dontwarn com.shuyu.gsyvideoplayer.utils.** -keep class com.shuyu.gsyvideoplayer.player.** {*;} -dontwarn com.shuyu.gsyvideoplayer.player.** -keep class tv.danmaku.ijk.** { *; } -dontwarn tv.danmaku.ijk.** -keep class androidx.media3.** {*;} -keep interface androidx.media3.** -keep class com.shuyu.alipay.** {*;} -keep interface com.shuyu.alipay.** -keep public class * extends android.view.View{ *** get*(); void set*(***); public <init>(android.content.Context); public <init>(android.content.Context, java.lang.Boolean); public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet, int); } 如果是阿里云播放器,可以?考?的文?( https://help.aliyun.com/document_detail/124711.html?spm=a2c4g.124711.0.0.7fa0125dkwUPoU ),需要新增一些 keep ??: -keep class com.alivc.**{*;} -keep class com.aliyun.**{*;} -keep class com.cicada.**{*;} -dontwarn com.alivc.** -dontwarn com.aliyun.** -dontwarn com.cicada.** ?馨提示 如果克隆太慢,可????云地址下? ?于自定?和出???的?先看??集?、demo、issue。 多了解一些音??的基?常?,?容器,音????,ffmpeg先做一些了解,以及mediacodec等的不同。 ?量少出??什??的能播的???。 播放器的可自定??是挺高的,定制??考demo,多看源?。?在的功能有些多,demo也在不?的更新。 一些新功能和?目??也在不?的?整。 ?迎提出??,??。 依?大小?考 建?使用ndk??,???考 ?考第四? : 4、NDK的so支持 Star History Chart 非常感??的支持 ??不易,如果??有所?助,?迎?的?? License ??看IJKPlayer和AndroidVideoCache相???。 ?目最?始是?jiecao??的,改着改着直接重?了。 偶?有一?量和方法名可能?有点jiaozi的影子,但是基本是一?新?目。