{"id":13455517,"url":"https://github.com/CarGuo/GSYVideoPlayer","last_synced_at":"2025-03-24T08:32:56.355Z","repository":{"id":37390761,"uuid":"73614722","full_name":"CarGuo/GSYVideoPlayer","owner":"CarGuo","description":"视频播放器（IJKplayer、ExoPlayer、MediaPlayer），HTTPS，16k page size，支持弹幕，外挂字幕，支持滤镜、水印、gif截图，片头广告、中间广告，多个同时播放，支持基本的拖动，声音、亮度调节，支持边播边缓存，支持视频自带rotation的旋转（90,270之类），重力旋转与手动旋转的同步支持，支持列表播放 ，列表全屏动画，视频加载速度，列表小窗口支持拖动，动画效果，调整比例，多分辨率切换，支持切换播放器，进度条小窗口预览，列表切换详情页面无缝播放，rtsp、concat、mpeg。 ","archived":false,"fork":false,"pushed_at":"2024-10-15T06:50:16.000Z","size":342152,"stargazers_count":20186,"open_issues_count":16,"forks_count":4188,"subscribers_count":429,"default_branch":"master","last_synced_at":"2024-10-28T18:11:56.541Z","etag":null,"topics":["16k","android","exoplayer","ffmpeg","gsy","ijkplayer","player","ssl","video","videocache"],"latest_commit_sha":null,"homepage":"https://juejin.cn/user/817692379985752/posts","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CarGuo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"custom":"http://img.cdn.guoshuyu.cn/thanks.jpg"}},"created_at":"2016-11-13T12:34:31.000Z","updated_at":"2024-10-28T07:25:47.000Z","dependencies_parsed_at":"2024-10-28T17:39:01.021Z","dependency_job_id":null,"html_url":"https://github.com/CarGuo/GSYVideoPlayer","commit_stats":{"total_commits":1454,"total_committers":25,"mean_commits":58.16,"dds":0.2434662998624484,"last_synced_commit":"78e21ee3fb58c09690357cad9485a9b2e6061cf3"},"previous_names":[],"tags_count":116,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarGuo%2FGSYVideoPlayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarGuo%2FGSYVideoPlayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarGuo%2FGSYVideoPlayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CarGuo%2FGSYVideoPlayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CarGuo","download_url":"https://codeload.github.com/CarGuo/GSYVideoPlayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221947651,"owners_count":16906157,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["16k","android","exoplayer","ffmpeg","gsy","ijkplayer","player","ssl","video","videocache"],"created_at":"2024-07-31T08:01:06.581Z","updated_at":"2024-10-28T22:31:15.000Z","avatar_url":"https://github.com/CarGuo.png","language":"Java","readme":"\n![](./img/home_logo.png)\n\n## 支持 [IJKPlayer](https://github.com/Bilibili/ijkplayer)、 [Media3(EXOPlayer2)](https://github.com/androidx/media)、MediaPlayer、AliPlayer，实现了多功能的视频播放器。 (请仔细阅读下方各项说明，大多数问题可在下方找到解答)。\n## 鸿蒙版本[openharmony-tpc/GSYVideoPlayer](https://gitee.com/openharmony-tpc/openharmony_tpc_samples/tree/master/GSYVideoPlayer)\n\n\u003e ## [如果克隆太慢或者图片看不到，可尝试从码云地址下载](https://gitee.com/CarGuo/GSYVideoPlayer)\n\n类型 | 功能\n-------- | ---\n**缓存**|**边播边缓存，使用了[AndroidVideoCache](https://github.com/danikula/AndroidVideoCache)；Media3(ExoPlayer)使用SimpleCache。**\n**协议**|**h263\\4\\5、Https、concat、rtsp、hls、rtmp、crypto、mpeg等等。[（ijk模式格式支持）](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/DECODERS.md)**\n**滤镜**|**简单滤镜（马赛克、黑白、色彩过滤、高斯、模糊、模糊等等20多种）、动画、（水印、画面多重播放等）。**\n**帧图**|**视频第一帧、视频帧截图功能，视频生成gif功能。**\n**播放**|**列表播放、列表连续播放、重力旋转与手动旋转、视频本身rotation旋转属性、快播和慢播、网络视频加载速度。**\n**画面**|**调整显示比例:默认、16:9、4:3、填充；播放时旋转画面角度（0,90,180,270）；镜像旋转。**\n**内核**|**IJKPlayer、Media3(EXOPlayer)、MediaPlayer、AliPlayer切换、自定义内核**\n**布局**|**全屏与非全屏两套布局切换、没有任何操作控件的纯播放支持、弹幕功能、继承自定义任何布局。**\n**播放**|**单例播放、多个同时播放、视频列表滑动自动播放、列表切换详情页面无缝播放。**\n**窗口**|**小窗口、多窗体下（包括桌面）的小窗口播放。**\n**广告**|**片头广告、跳过广告支持、中间插入广告功能。**\n**字幕**|**[media3(exo2)模式下支持自定增加外挂字幕](https://github.com/CarGuo/GSYVideoPlayer/tree/master/app/src/main/java/com/example/gsyvideoplayer/exosubtitle)。**\n**dash**|**media3(exo2) 模式支持dash**\n**stream**|**支持元数据播放**\n**适配 16k**|**ex_so 适配 16K Page Size**\n**openssl**|**目前 arm64 使用 openssl 1.1.1w**\n**FFmpeg**|**目前 arm64 使用 FFmpeg 4.1.6**\n**FFmpeg**|**目前 ex_so 的 arm64 支持 G711a(pcm_alaw)**\n**更多**|**暂停前后台切换不黑屏；调整不同清晰度的支持；无缝切换支持；锁定/解锁全屏点击功能；进度条小窗口预览（测试）。**\n**自定义**|**可自定义渲染层、自定义管理层、自定义播放层（控制层）、自定义缓存层。**\n\n[![](https://jitpack.io/v/CarGuo/GSYVideoPlayer.svg)](https://jitpack.io/#CarGuo/GSYVideoPlayer)\n[![Build Status](https://app.travis-ci.com/CarGuo/GSYVideoPlayer.svg?branch=master)](https://app.travis-ci.com/CarGuo/GSYVideoPlayer)\n[![Github Actions](https://github.com/CarGuo/GSYVideoPlayer/workflows/CI/badge.svg)](https://github.com/CarGuo/GSYVideoPlayer/actions)\n\n[]()\n[![GitHub stars](https://img.shields.io/github/stars/CarGuo/GSYVideoPlayer.svg)](https://github.com/CarGuo/GSYVideoPlayer/stargazers)\n[![GitHub forks](https://img.shields.io/github/forks/CarGuo/GSYVideoPlayer.svg)](https://github.com/CarGuo/GSYVideoPlayer/network)\n[![GitHub issues](https://img.shields.io/github/issues/CarGuo/GSYVideoPlayer.svg)](https://github.com/CarGuo/GSYVideoPlayer/issues)\n[![GitHub license](https://img.shields.io/github/license/CarGuo/GSYVideoPlayer.svg)](https://github.com/CarGuo/GSYVideoPlayer/blob/master/LICENSE)\n\n\n| 公众号   | 掘金     |  知乎    |  CSDN   |   简书\n|---------|---------|--------- |---------|---------|\n| GSYTech  |  [点我](https://juejin.im/user/582aca2ba22b9d006b59ae68/posts)    |   [点我](https://www.zhihu.com/people/carguo)       |   [点我](https://blog.csdn.net/ZuoYueLiang)  |   [点我](https://www.jianshu.com/u/6e613846e1ea)\n\n\n![](http://img.cdn.guoshuyu.cn/WeChat-Code)\n\n### [--------------Demo APK 下载地址---------------](https://github.com/CarGuo/GSYVideoPlayer/releases)\n\n## 一、使用依赖\n\n#### [--- 版本更新说明 --- ](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/UPDATE_VERSION.md)。\n\n\n### 1、Jitpack 引入方法（推荐， JCenter 即将关闭）\n\n\n#### First、在project下的build.gradle添加\n\n```\nallprojects {\n    repositories {\n\t\t...\n        maven { url 'https://jitpack.io' }\n        maven { url \"https://maven.aliyun.com/repository/public\" }\n    }\n}\n```\n\n**你可以选择下面三种的其中一种，在module下的build.gradle添加。**\n\n#### A、直接引入\n```\n //完整版引入\n implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer:v9.0.0-release-jitpack'\n\n\n //是否需要AliPlayer模式\n implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-aliplay:v9.0.0-release-jitpack'\n```\n\n#### B、添加java和你想要的so支持：\n\n```\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v9.0.0-release-jitpack'\n\n //是否需要ExoPlayer模式\n implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-exo2:v9.0.0-release-jitpack'\n\n //是否需要AliPlayer模式\n implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-aliplay:v9.0.0-release-jitpack'\n\n //根据你的需求ijk模式的so\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-arm64:v9.0.0-release-jitpack'\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv7a:v9.0.0-release-jitpack'\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-armv5:v9.0.0-release-jitpack'\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x86:v9.0.0-release-jitpack'\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-x64:v9.0.0-release-jitpack'\n```\n\n#### C、支持其他格式协议的（mpeg，rtsp, concat、crypto协议，支持 16k Page Size）\n\nA、B普通版本支持263/264/265等，对于mpeg编码会有声音无画面情况。\nC 引入的so支持mpeg编码和其他补充协议，但是so包相对变大。\n\n```\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-java:v9.0.0-release-jitpack'\n\n //是否需要ExoPlayer模式\n implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-exo2:v9.0.0-release-jitpack'\n\n //是否需要AliPlayer模式\n implementation 'com.github.CarGuo.GSYVideoPlayer:GSYVideoPlayer-aliplay:v9.0.0-release-jitpack'\n\n //更多ijk的编码支持\n implementation 'com.github.CarGuo.GSYVideoPlayer:gsyVideoPlayer-ex_so:v9.0.0-release-jitpack'\n\n```\n\n#### 代码中的全局切换支持（更多请参看下方文档和demo）\n\n```\n\n//EXOPlayer内核，支持格式更多\nPlayerFactory.setPlayManager(Exo2PlayerManager.class);\n//系统内核模式\nPlayerFactory.setPlayManager(SystemPlayerManager.class);\n//ijk内核，默认模式\nPlayerFactory.setPlayManager(IjkPlayerManager.class);\n//aliplay 内核，默认模式\nPlayerFactory.setPlayManager(AliPlayerManager.class);\n\n\n//exo缓存模式，支持m3u8，只支持exo\nCacheFactory.setCacheManager(ExoPlayerCacheManager.class);\n//代理缓存模式，支持所有模式，不支持m3u8等，默认\nCacheFactory.setCacheManager(ProxyCacheManager.class);\n\n\n\n//切换渲染模式\nGSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL);\n//默认显示比例\nGSYVideoType.SCREEN_TYPE_DEFAULT = 0;\n//16:9\nGSYVideoType.SCREEN_TYPE_16_9 = 1;\n//4:3\nGSYVideoType.SCREEN_TYPE_4_3 = 2;\n//全屏裁减显示，为了显示正常 CoverImageView 建议使用FrameLayout作为父布局\nGSYVideoType.SCREEN_TYPE_FULL = 4;\n//全屏拉伸显示，使用这个属性时，surface_container建议使用FrameLayout\nGSYVideoType.SCREEN_MATCH_FULL = -4;\n/***\n * SCREEN_TYPE_CUSTOM 下自定义显示比例\n * @param screenScaleRatio  高宽比，如 16：9\n */\npublic static void setScreenScaleRatio(float screenScaleRatio)\n\n\n//切换绘制模式\nGSYVideoType.setRenderType(GSYVideoType.SUFRACE);\nGSYVideoType.setRenderType(GSYVideoType.GLSURFACE);\nGSYVideoType.setRenderType(GSYVideoType.TEXTURE);\n\n\n//ijk关闭log\nIjkPlayerManager.setLogLevel(IjkMediaPlayer.IJK_LOG_SILENT);\n\n\n//exoplayer自定义MediaSource\nExoSourceManager.setExoMediaSourceInterceptListener(new ExoMediaSourceInterceptListener() {\n    @Override\n    public MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir) {\n        //可自定义MediaSource\n        return null;\n    }\n});\n\n```\n\n### [--- 更多依赖方式请点击 - ](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/DEPENDENCIES.md)\n\n## 二、其他推荐\n\n### * 我所在的技术社区：[掘金](https://juejin.cn/user/817692379985752/posts)\n### * QQ群，有兴趣的欢迎（平时吹水吐槽多，因为人数饱和，就是日常瞎扯，没人解决问题的）：174815284 。\n### * [Flutter Github客户端](https://github.com/CarGuo/gsy_github_app_flutter) 、[React Native Github客户端](https://github.com/CarGuo/GSYGithubAPP) 、 [Weex Github客户端](https://github.com/CarGuo/GSYGithubAPPWeex) 、 [原生 Kotlin Github客户端](https://github.com/CarGuo/GSYGithubAPPKotlin)\n### * [RxFFmpeg Android 的音视频编辑工具](https://github.com/microshow/RxFFmpeg)\n### * [oarplayer Rtmp播放器,基于MediaCodec与srs-librtmp,不依赖ffmpeg](https://github.com/qingkouwei/oarplayer)\n### * 鸿蒙版本[openharmony-tpc/GSYVideoPlayer](https://gitee.com/openharmony-tpc/openharmony_tpc_samples/tree/master/GSYVideoPlayer)\n\n\n## 三、文档Wiki\n\n文档 | 传送门\n-------- | ---\n**使用说明**|***[--- 简单使用，快速上手文档](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/USE.md)***\n**建议阅读**|***[--- 移动开发者必知的音视频基础知识1](https://juejin.cn/post/7057132141875822622)、[--- 移动开发者必知的音视频基础知识2](https://mp.weixin.qq.com/s/HjSdmAsHuvixCH_EWdvk3Q)***\n**项目解析说明**|***[--- 项目解析说明、包含项目架构和解析](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/GSYVIDEO_PLAYER_PROJECT_INFO.md)***\n接口文档入口|**[--- 使用说明、接口文档 - 入口](https://github.com/CarGuo/GSYVideoPlayer/wiki)**\n**问题集锦入口**|***[--- 问题集锦 - 入口（大部分你遇到的问题都在这里解决） ](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/QUESTION.md)***\n编码格式|**[--- IJK so文件配置格式说明](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/DECODERS.md)**\n编译自定义SO|**[--- IJKPlayer编译自定义SO - 入口](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/BUILD_SO.md)**\n版本更新说明|**[--- 版本更新说明 - 入口](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/UPDATE_VERSION.md)**\ncompileSdk 太高|--- **[#3514](https://github.com/CarGuo/GSYVideoPlayer/issues/3514)**\n\n\n\n\n![框架图](./img/StructureChart2.jpg)\n\n## 四、运行效果\n\n* ### 1、打开一个播放(旋转、镜像、填充)\n\u003cimg src=\"./img/11.gif\" width=\"240px\" height=\"426px\"/\u003e\n\n* ### 2、列表/详情模式(动画、旋转、小窗体)\n\n\u003cdiv\u003e\n\u003cimg src=\"./img/22.gif\" width=\"240px\" height=\"426px\"/\u003e\n\u003cimg src=\"./img/33.gif\" width=\"240px\" height=\"426px\"/\u003e\n\u003cimg src=\"./img/44.gif\" width=\"240px\" height=\"426px\"/\u003e\n\u003c/div\u003e\n\n* ### 3、弹幕\n\u003cimg src=\"./img/55.gif\" width=\"240px\" height=\"426px\"/\u003e\n\n* ### 4、滤镜和GL动画\n\u003cimg src=\"./img/09.gif\"/\u003e\n\n* ### 6、背景铺满模糊播放\n\n\u003cimg src=\"./img/99.png\" width=\"426px\" height=\"240px\"/\u003e\n\n* ### 7、进度条小窗口预览\n\u003cimg src=\"./img/07.gif\" height=\"240px\"/\u003e\n\n## 五、近期版本\n\n###  v9.0.0-release-jitpack (2024-07-29)\n* ex_so support 16k page size\n* update media3 1.4.0\n* fix #4014\n* fix #3999 \u0026 #3649 system mediaPlayer setSpeed cause play\n* fix #3972  ListGSYVideoPlayer 轮播场景焦点未移除导致播放器状态错误\n\n###  v8.6.0-release-jitpack (2024-03-07)\n* update media 1.3.0\n* update exo source intercept listener\n* fix #3900\n\n###  v8.5.0-release-jitpack (2023-11-20)\n* update media 1.2.0 \u0026  compileSdk 34\n* update exoplayer to androidx media\n* fix #3874\n* fix issues 3855 (#3856)\n* add #3843\n\n\n\n### 更多版本请查阅：[版本更新说明](https://github.com/CarGuo/GSYVideoPlayer/blob/master/doc/UPDATE_VERSION.md)\n\n## 六、关于Issues\n\n```\n提问题前可先查阅上方文档和说明，请在Demo中复现问题。\n\n问题说明：\n\n1、说明那个Demo中哪个页面。\n2、问题显现和重现步骤。\n3、补充问题的视频流url，截图。\n4、补充问题的机型，android版本。\n```\n\n## 七、混淆\n\n```\n-keep class com.shuyu.gsyvideoplayer.video.** { *; }\n-dontwarn com.shuyu.gsyvideoplayer.video.**\n-keep class com.shuyu.gsyvideoplayer.video.base.** { *; }\n-dontwarn com.shuyu.gsyvideoplayer.video.base.**\n-keep class com.shuyu.gsyvideoplayer.utils.** { *; }\n-dontwarn com.shuyu.gsyvideoplayer.utils.**\n-keep class com.shuyu.gsyvideoplayer.player.** {*;}\n-dontwarn com.shuyu.gsyvideoplayer.player.**\n-keep class tv.danmaku.ijk.** { *; }\n-dontwarn tv.danmaku.ijk.**\n-keep class androidx.media3.** {*;}\n-keep interface androidx.media3.**\n\n-keep class com.shuyu.alipay.** {*;}\n-keep interface com.shuyu.alipay.**\n\n-keep public class * extends android.view.View{\n    *** get*();\n    void set*(***);\n    public \u003cinit\u003e(android.content.Context);\n    public \u003cinit\u003e(android.content.Context, java.lang.Boolean);\n    public \u003cinit\u003e(android.content.Context, android.util.AttributeSet);\n    public \u003cinit\u003e(android.content.Context, android.util.AttributeSet, int);\n}\n```\n\n如果是阿里云播放器，可以参考它的文档（ https://help.aliyun.com/document_detail/124711.html?spm=a2c4g.124711.0.0.7fa0125dkwUPoU ），需要新增一些 keep 规则：\n\n```\n-keep class com.alivc.**{*;}\n-keep class com.aliyun.**{*;}\n-keep class com.cicada.**{*;}\n-dontwarn com.alivc.**\n-dontwarn com.aliyun.**\n-dontwarn com.cicada.**\n```\n\n## 温馨提示\n\n#### [如果克隆太慢，可尝试从码云地址下载](https://gitee.com/CarGuo/GSYVideoPlayer)\n\n```\n关于自定义和出现问题的请先看问题集锦、demo、issue。\n\n多了解一些音视频的基础常识，对容器，音视频编码，ffmpeg先做一些了解，以及mediacodec等的不同。\n尽量少出现为什么别的能播的问题哟。\n\n播放器的可自定义还是挺高的，定制请参考demo，多看源码。现在的功能有些多，demo也在不断的更新。\n\n一些新功能和项目结构也在不断的调整。\n\n欢迎提出问题，谢谢。\n\n```\n\n## 依赖大小参考\n建议使用ndk过滤，详细参考 [参考第四条 ： 4、NDK的so支持](http://www.jianshu.com/p/86e4b336c17d)\n![](https://ooo.0o0.ooo/2017/06/15/5941f343a39f5.png)\n\n\n## Star History Chart\n[![Star History Chart](https://api.star-history.com/svg?repos=CarGuo/GSYVideoPlayer\u0026type=Date)](https://star-history.com/#CarGuo/GSYVideoPlayer\u0026Date)\n\n\n\n## 温馨提示\n开源项目主要提供交流学习，并不提供技术支持，也不接商务合作，纯公益兴趣开源\n\n\n\n\n\n## License\n\n```\n请参看IJKPlayer和AndroidVideoCache相关协议。\n项目最开始是从jiecao过来的，改着改着直接重构了。\n偶尔有一变量和方法名可能还有点jiaozi的影子，但是基本是一个新项目。\n```\n","funding_links":["http://img.cdn.guoshuyu.cn/thanks.jpg"],"categories":["Java","HarmonyOS","Mobile Development"],"sub_categories":["Windows Manager","C++/C Toolkit"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCarGuo%2FGSYVideoPlayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCarGuo%2FGSYVideoPlayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCarGuo%2FGSYVideoPlayer/lists"}