MCPcopy
hub / github.com/CarGuo/GSYVideoPlayer

github.com/CarGuo/GSYVideoPlayer @v13.1.0 sqlite

repository ↗ · DeepWiki ↗ · release v13.1.0 ↗
4,259 symbols 11,997 edges 309 files 1,028 documented · 24%
README

中文文档

Supports IJKPlayer, Media3(EXOPlayer2), MediaPlayer, AliPlayer, implementing a multi-functional video player. (Please read the following instructions carefully, most questions can be answered below).

* HarmonyOS version openharmony-tpc/GSYVideoPlayer

If cloning is too slow or images are not visible, you can try to synchronize from the following addresses

  • GitCode https://gitcode.com/ZuoYueLiang/GSYVideoPlayer
  • Gitee:https://gitee.com/CarGuo/GSYVideoPlayer
Type Function
Cache Play while caching, using AndroidVideoCache; Media3(ExoPlayer) uses SimpleCache.
Protocols h263\4\5, Https, concat, rtsp, hls, rtmp, crypto, mpeg, etc. (ijk mode format support)
Filters Simple filters (mosaic, black and white, color filter, Gaussian, blur, etc. more than 20 kinds), animation, (watermark, multi-screen playback, etc.).
Frame images Video first frame, video frame screenshots, composed player screenshots including UI, and video to gif function.
Playback List playback, continuous list playback, gravity rotation and manual rotation, video's own rotation attribute, fast and slow playback, network video loading speed.
Screen Adjust display ratio: default, 16:9, 4:3, fill; rotate screen angle during playback (0,90,180,270); mirror rotation.
Kernel IJKPlayer, Media3(EXOPlayer), MediaPlayer, AliPlayer switching, custom kernel
Layout Full screen and non-full screen two sets of layout switching, pure playback support without any operation controls, barrage function, inherited custom any layout.
Playback Singleton playback, multiple simultaneous playback, video list sliding automatic playback, seamless playback of list switching detail pages.
Window Small window, small window playback in multiple windows (including desktop).
Ads Opening ads, skip ad support, interstitial ad function.
Subtitles Unified external subtitle overlay supports SRT/WebVTT across IJK, Media3(EXOPlayer), and MediaPlayer; Media3 embedded cues can bridge to the same UI.
Dash Media3(exo2) mode supports dash; the demo supports HLS master / DASH MPD adaptive quality track switching.
Stream Supports metadata playback
Adapt 16k ex_so adapts to 16K Page Size
openssl Currently ex_so's arm64/x86_64 uses openssl 1.1.1w
FFmpeg Currently ex_so's arm64/x86_64 uses FFmpeg 4.3
FFmpeg Currently ex_so's arm64/x86_64 supports G711a(pcm_alaw)
More No black screen when pausing front and back switching; multi-URL quality switching; Exo HLS/DASH adaptive quality; seamless switching support; keep-last-frame demo; WebVTT progress bar preview.
Customization Customizable rendering layer, custom management layer, custom playback layer (control layer), custom cache layer.

Maven Central Version Build Status Github Actions

GitHub stars GitHub forks GitHub issues GitHub License

Star

Official Account Juejin Zhihu CSDN Jianshu
GSYTech Click me Click me Click me Click me

--------------Demo APK Download Address---------------

I. Using Dependencies

There are currently three hosting methods:

  • MavenCentral: Available after version 11.0.0, all base class packages are published and hosted here.
  • Github Package: Available from version 9.1.0, but before version 11.0.0, the basic dependencies of GSYIjkJava are still hosted on jitpack.
  • Jitpack IO: Will continue to be released, but there is a random loss of packages on the hosting platform.

--- Version Update Instructions --- .

--- Recent Playback Features --- .

1. MavenCentral Reference (Recommended)

Since jitpack keeps losing packages, it has been migrated to MavenCentral. The usage is as follows:

First Add

allprojects {
    repositories {
        ///...
        mavenCentral()
        maven { url "https://maven.aliyun.com/repository/public" }
    }
}

You can choose one of the following three and add it to the build.gradle under the module.

A. Direct Introduction

 //Complete version introduction

implementation 'io.github.carguo:gsyvideoplayer:13.1.0'


//Whether AliPlayer mode is needed
implementation 'io.github.carguo:gsyvideoplayer-aliplay:13.1.0'

B. Add java and the so support you want:

 implementation 'io.github.carguo:gsyvideoplayer-java:13.1.0'

 //Whether ExoPlayer mode is needed
 implementation 'io.github.carguo:gsyvideoplayer-exo2:13.1.0'

 //Whether AliPlayer mode is needed
 implementation 'io.github.carguo:gsyvideoplayer-aliplay:13.1.0'

 //so of ijk mode according to your needs
 implementation 'io.github.carguo:gsyvideoplayer-arm64:13.1.0'
 implementation 'io.github.carguo:gsyvideoplayer-armv7a:13.1.0'
 implementation 'io.github.carguo:gsyvideoplayer-armv5:13.1.0'
 implementation 'io.github.carguo:gsyvideoplayer-x86:13.1.0'
 implementation 'io.github.carguo:gsyvideoplayer-x64:13.1.0'

C. Support other format protocols (mpeg, rtsp, concat, crypto protocols, support 16k Page Size)

A and B normal versions support 263/264/265, etc. For mpeg encoding, there will be sound but no picture. The so introduced by C supports mpeg encoding and other supplementary protocols, but the so package is relatively larger.

 implementation 'io.github.carguo:gsyvideoplayer-java:13.1.0'

 //Whether ExoPlayer mode is needed
 implementation 'io.github.carguo:gsyvideoplayer-exo2:13.1.0'

 //Whether AliPlayer mode is needed
 implementation 'io.github.carguo:gsyvideoplayer-aliplay:13.1.0'

 //More ijk encoding support
 implementation 'io.github.carguo:gsyvideoplayer-ex_so:13.1.0'

D. Jetpack Compose Support (Optional)

The gsyvideoplayer-compose module is published with v13.1.0. It can be consumed from Maven Central / GitHub Packages like the other modules, or by depending on the source module directly with implementation project(":gsyVideoPlayer-compose") when working inside this repository.

🛠 Toolchain note: the Compose module is verified on JDK 21 in CI (.github/workflows/*.ymlactions/setup-java java-version: 21) and JDK 17 locally (the module pins sourceCompatibility / targetCompatibility / jvmTarget = 17 in gsyVideoPlayer-compose/build.gradle). Both are fine; just make sure your local JDK is ≥ 17 so Kotlin 2.0.21 + AGP 8.6.1 can build.

The new gsyvideoplayer-compose module exposes Compose entries on top of the existing kernels and UI without touching any legacy code:

  • Wrapper mode: a single Composable GSYVideoPlayerView { ... } embeds StandardGSYVideoPlayer into a Compose screen, with automatic Lifecycle bridge and release on dispose. An optional setUpKey: Any? parameter lets you trigger setUp again only when the data identity changes (idempotent).
  • Native mode: GSYComposeHostPlayer + GSYPlayerController exposes a GSYPlayerSnapshot state stream plus an events: SharedFlow<GSYPlayerEvent> of one-shot edge events (Prepared / AutoComplete / Error), so the control UI can be drawn entirely in Compose while the rendering pipeline still uses the GSY multi-kernel core. The legacy setOnError / setOnComplete / setOnPrepared setters are still supported but @Deprecated in favour of the Flow API.
// Maven Central:
implementation 'io.github.carguo:gsyvideoplayer-compose:13.1.0'

// Source dependency for local development:
implementation project(':gsyVideoPlayer-compose')
// compose-bom is api-exposed from the module; consumers still manage androidx.compose.* per their own project setup.

See doc/COMPOSE_USE.md. The sample app provides a Compose Demo entry with 24 runnable Compose Activities — covering Wrapper basics, Native detail/list/multi-window/auto-play/seamless-switch, plus P5 differentiating capabilities (filter, cache/download, ad pre-roll, subtitle, custom danmaku, EXO multi-source, parallel multi-window) and P5-2 modern app patterns (vertical short video, floating window, multi-type list, web mixed layout, audio-only, URL/local file, MediaCodec hardware switch, themed custom controls). DemoSamples.kt is a shared data object of test URLs, not a runnable Activity. Outstanding gaps and the rolling roadmap are tracked in doc/COMPOSE_BACKLOG.md.

2. Github Package Dependency Method (Recommended)

Since Jitpack often has the problem of random loss of historical packages, a new Github Package dependency method is added. The usage is as follows:

However, accessing github package requires a token to access, which is more troublesome, but it is stable.

allprojects {
    repositories {
        //...
        maven {
            url 'https://maven.pkg.github.com/CarGuo/GSYVideoPlayer'

            // You can also use your own GitHub account and token
            // For convenience, I have provided a token for an infrequently used account here
            credentials {
                // your github name
                username = 'carsmallguo'
                // your github generate new token
                password = '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'
            }
        }
        maven {
            url "https://maven.aliyun.com/repository/public"
        }
        mavenCentral()

    }
}
  • To generate your own token, you can see: https://docs.github.com/zh/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens

In theory, it is the avatar in the upper right corner - Settings - Developer Settings - Personal access tokens - tokens (classic) - Generate new token (classic) - read:packages Remember to choose permanent for the expiration time

Tip: this repository's root build.gradle already supports reading the GitHub Packages credentials from a Gradle property or environment variable, so you don't have to hard-code your own token in the source tree:

```properties

~/.gradle/gradle.properties (recommended for local builds)

githubReadUser= githubReadToken= ```

Or in CI:

bash export GITHUB_READ_USER=<your-github-name> export GITHUB_READ_TOKEN=<your-classic-token-with-read:packages>

The hard-coded carsmallguo / ghp_... pair is only kept as a fallback so first-time clones still build out of the box; it may be revoked at any time, so prefer providing your own.

You can choose one of the following three and add it to the build.gradle under the module.

A. Direct Introduction

 //Complete version introduction
 implementation 'com.shuyu:gsyvideoplayer:13.1.0'


 //Whether AliPlayer mode is needed
 implementation 'com.shuyu:gsyvideoplayer-aliplay:13.1.0'

B. Add java and the so support you want:

```groovy implementation 'com.shuyu:gsyvideoplayer-java:13.1.0'

//Whether ExoPlayer mode is needed implementation 'com.shuyu:gsyvideoplayer-exo2:13.1.0'

//Whether AliPlayer mode is needed implementation 'com.shuyu:gsyvideoplayer-aliplay:13.1.0'

//so of ijk mode according to your needs implementation 'com.shuyu:gsyvideoplayer-armv5:13.1.0' implementation 'com.shuyu:gsyvideoplayer-armv7a:13.1.0' implementation 'com.shuyu:gsyvideoplayer-arm64:13.1.0' implementation 'com.shuyu:gsyvideoplayer-x86:13.1.0' implementation 'com.shuyu:gsyvideoplayer-x64:13.1

Extension points exported contracts — how you extend this code

MeasureFormVideoParamsListener (Interface)
构造宽高所需要的视频相关参数 [7 implementers]
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/MeasureHelper.java
IPlayerManager (Interface)
播放器差异管理接口 Created by guoshuyu on 2018/1/11. [7 implementers]
gsyVideoPlayer-base/src/main/java/com/shuyu/gsyvideoplayer/player/IPlayerManager.java
CacheListener (Interface)
Listener for cache availability. @author Egor Makovsky (yahor.makouski@gmail.com) @author Alexey Danilov (danikula@gmai [6 …
gsyVideoPlayer-proxy_cache/src/main/java/com/danikula/videocache/CacheListener.java
BufferingHook (Interface)
Compose 端 Controller 注入的 hook,转发底层 [com.shuyu.gsyvideoplayer.listener.GSYMediaPlayerListener] 中 VideoAllCallBack 不覆盖的 bu [4 …
gsyVideoPlayer-compose/src/main/java/com/shuyu/gsyvideoplayer/compose/native_/GSYComposeHostPlayer.java
OnScrollListener (Interface)
(no doc) [9 implementers]
app/src/main/java/com/example/gsyvideoplayer/view/ScrollWebView.java
ExoMediaSourceInterceptListener (Interface)
设置 ExoPlayer 的 MediaSource 创建拦截 Created by guoshuyu Date: 2018-08-22 [1 implementers]
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/ExoMediaSourceInterceptListener.java
IGSYRenderView (Interface)
Created by guoshuyu on 2018/1/29. [10 implementers]
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/view/IGSYRenderView.java
ICacheManager (Interface)
缓存管理接口 Created by guoshuyu on 2018/5/18. [4 implementers]
gsyVideoPlayer-base/src/main/java/com/shuyu/gsyvideoplayer/cache/ICacheManager.java

Core symbols most depended-on inside this repo

printfLog
called by 143
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/Debuger.java
printfError
called by 107
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/Debuger.java
setText
called by 96
app/src/main/java/com/example/gsyvideoplayer/holder/RecyclerPageItemViewHolder.java
setViewShowState
called by 95
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java
getGSYVideoManager
called by 80
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java
get
called by 72
gsyVideoPlayer-proxy_cache/src/main/java/com/danikula/videocache/sourcestorage/SourceInfoStorage.java
isEmpty
called by 70
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/subtitle/GSYSubtitleMime.java
getFullscreenButton
called by 70
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java

Shape

Method 3,890
Class 324
Interface 43
Enum 2

Languages

Java100%

Modules by API surface

gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoControlView.java120 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/GSYVideoBaseManager.java88 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYVideoView.java85 symbols
gsyVideoPlayer-exo_player2/src/main/java/tv/danmaku/ijk/media/exo2/IjkExo2MediaPlayer.java84 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/GSYVideoHelper.java76 symbols
app/src/main/java/com/example/gsyvideoplayer/utils/SmallVideoHelper.java75 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/base/GSYBaseVideoPlayer.java64 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/video/StandardGSYVideoPlayer.java60 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/utils/ListVideoUtil.java57 symbols
gsyVideoPlayer-aliplay/src/main/java/com/shuyu/aliplay/AliMediaPlayer.java53 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/render/view/GSYVideoGLView.java51 symbols
gsyVideoPlayer-java/src/main/java/com/shuyu/gsyvideoplayer/builder/GSYVideoOptionBuilder.java50 symbols

For agents

$ claude mcp add GSYVideoPlayer \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact