GSYVideoPlayer README

README проекта с github.com/CarGuo/GSYVideoPlayer. Одним файлом markdown: README.md.

中文文档

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

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 Basic filters, watermarks, multi-screen playback, multi-pass Gaussian/pyramid blur, Bloom, LUT grading, beauty, Glitch, CRT and analog-TV interference. Details.
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 and arm64/x64 adapt to 16K Page Size
openssl Currently ex_so and arm64/armv7a/x64 all use OpenSSL 3.5.9
FFmpeg Currently ex_so and arm64/armv7a/x64 (arm64-v8a / armeabi-v7a / x86_64) all use FFmpeg n5.1.10
FFmpeg Currently ex_so and arm64/armv7a/x64 (arm64-v8a / armeabi-v7a / x86_64) all support G711a(pcm_alaw)
Cast Optional gsyvideoplayer-cast DLNA/UPnP module built on jUPnP 3.0.3; the core keeps only the protocol-neutral CastCapability / CastProvider / CastSession SPI and does not pull Jetty. Details.
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.
Foldables XML / Compose FLAT, BOOK and TABLETOP split/fullscreen demos using FoldingFeature hinge information.

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:

--- Version Update Instructions --- .

--- Recent Playback Features --- .

ABI and dependency selection in v14.1.0

The gsyvideoplayer aggregate already includes Java, Exo2 and ex_so. For modular IJK setup, choose ex_so or the required standalone ABI modules; do not include two native sets for the same ABI.

Native artifact ABI Native libraries in this release
gsyvideoplayer-ex_so arm64-v8a / armeabi-v7a / x86_64 FFmpeg n5.1.10 + OpenSSL 3.5.9
gsyvideoplayer-arm64 arm64-v8a Identical to the matching ex_so tuple
gsyvideoplayer-armv7a armeabi-v7a Identical to the matching ex_so tuple
gsyvideoplayer-x64 x86_64 Identical to the matching ex_so tuple
gsyvideoplayer-armv5 / gsyvideoplayer-x86 Legacy armeabi / x86 Historical libraries, not upgraded to FFmpeg 5; explicit legacy use only

Migrated standalone modules and ex_so share codec/protocol configuration. Choose by ABI and package size, rather than the former standard/extended MPEG distinction. Add compose, cast and aliplay only as needed; cast requires API 26, while the core requires API 23. See DECODERS_EN.md and BUILD_SO_EN.md.

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:14.1.0'


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

//Whether DLNA/UPnP casting is needed (optional, minSdk 26)
implementation 'io.github.carguo:gsyvideoplayer-cast:14.1.0'

B. Add java and the so support you want:

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

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

 //Optional direct RTMP module; exo2 already exposes it transitively
 implementation 'io.github.carguo:gsyvideoplayer-rtmp:14.1.0'

 //Optional DLNA/UPnP cast implementation (minSdk 26); the default player does not include Jetty
 implementation 'io.github.carguo:gsyvideoplayer-cast:14.1.0'

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

 //Select required ABIs; do not also add ex_so
 implementation 'io.github.carguo:gsyvideoplayer-arm64:14.1.0'
 implementation 'io.github.carguo:gsyvideoplayer-armv7a:14.1.0'
 implementation 'io.github.carguo:gsyvideoplayer-x64:14.1.0'

C. Modular setup with all three migrated ABIs

ex_so bundles all three migrated ABIs with the same codec configuration as the standalone modules in B. Select B when only a subset of ABIs is needed.

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

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

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

 //IJK native libraries for the three migrated ABIs
 implementation 'io.github.carguo:gsyvideoplayer-ex_so:14.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/*.yml — actions/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.9.1 can build.

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

// Maven Central:
implementation 'io.github.carguo:gsyvideoplayer-compose:14.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 25 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), plus the v14 foldable BOOK/TABLETOP demo. 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.

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()

    }
}

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:

# ~/.gradle/gradle.properties (recommended for local builds)
githubReadUser=<your-github-name>
githubReadToken=<your-classic-token-with-read:packages>

Or in CI:

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:14.1.0'


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

 //Whether DLNA/UPnP casting is needed (optional, minSdk 26)
 implementation 'com.shuyu:gsyvideoplayer-cast:14.1.0'

B. Add java and the so support you want:

 implementation 'com.shuyu:gsyvideoplayer-java:14.1.0'

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

 //Optional direct RTMP module; exo2 already exposes it transitively
 implementation 'com.shuyu:gsyvideoplayer-rtmp:14.1.0'

 //Optional DLNA/UPnP cast implementation (minSdk 26); the default player does not include Jetty
 implementation 'com.shuyu:gsyvideoplayer-cast:14.1.0'

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

 //Select required ABIs; do not also add ex_so
 implementation 'com.shuyu:gsyvideoplayer-armv7a:14.1.0'
 implementation 'com.shuyu:gsyvideoplayer-arm64:14.1.0'
 implementation 'com.shuyu:gsyvideoplayer-x64:14.1.0'

C. Modular setup with all three migrated ABIs

ex_so bundles all three migrated ABIs with the same codec configuration as the standalone modules in B. Select B when only a subset of ABIs is needed.

 implementation 'com.shuyu:gsyvideoplayer-java:14.1.0'

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


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

 //IJK native libraries for the three migrated ABIs
 implementation 'com.shuyu:gsyvideoplayer-ex_so:14.1.0'

D. Jetpack Compose Support (Optional)

 implementation 'com.shuyu:gsyvideoplayer-compose:14.1.0'

3. Jitpack Introduction Method (will continue to be released, but not highly recommended)

Historical packages may have random packet loss, and it is not easy to supplement, see #4144:

First, add in the build.gradle under the project

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

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.github.CarGuo.GSYVideoPlayer:gsyvideoplayer:v14.1.0'


 //Whether AliPlayer mode is needed
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-aliplay:v14.1.0'

 //Whether DLNA/UPnP casting is needed (optional, minSdk 26)
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-cast:v14.1.0'

B. Add java and the so support you want:

 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-java:v14.1.0'

 //Whether ExoPlayer mode is needed
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-exo2:v14.1.0'

 //Optional DLNA/UPnP cast implementation (minSdk 26)
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-cast:v14.1.0'

 //Whether AliPlayer mode is needed
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-aliplay:v14.1.0'

 //Select required ABIs; do not also add ex_so
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-arm64:v14.1.0'
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-armv7a:v14.1.0'
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-x64:v14.1.0'

C. Modular setup with all three migrated ABIs

ex_so bundles all three migrated ABIs with the same codec configuration as the standalone modules in B. Select B when only a subset of ABIs is needed.

 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-java:v14.1.0'

 //Whether ExoPlayer mode is needed
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-exo2:v14.1.0'

 //Whether AliPlayer mode is needed
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-aliplay:v14.1.0'

 //IJK native libraries for the three migrated ABIs
 implementation 'com.github.CarGuo.GSYVideoPlayer:gsyvideoplayer-ex_so:v14.1.0'

Global switching support in code (for more, please refer to the documentation and demo below)


//EXOPlayer kernel, supports more formats
PlayerFactory.setPlayManager(Exo2PlayerManager.class);
//System kernel mode
PlayerFactory.setPlayManager(SystemPlayerManager.class);
//ijk kernel, default mode
PlayerFactory.setPlayManager(IjkPlayerManager.class);
//aliplay kernel, default mode
PlayerFactory.setPlayManager(AliPlayerManager.class);


//exo cache mode, supports m3u8, only supports exo
//Set before Exo cache is created. Default is 512 MB.
ExoSourceManager.setCacheMaxSize(1024L * 1024L * 1024L);
CacheFactory.setCacheManager(ExoPlayerCacheManager.class);
//Proxy cache mode, supports all modes, does not support m3u8, etc., default
CacheFactory.setCacheManager(ProxyCacheManager.class);



//Switch rendering mode
GSYVideoType.setShowType(GSYVideoType.SCREEN_MATCH_FULL);
//Default display ratio
GSYVideoType.SCREEN_TYPE_DEFAULT = 0;
//16:9
GSYVideoType.SCREEN_TYPE_16_9 = 1;
//4:3
GSYVideoType.SCREEN_TYPE_4_3 = 2;
//Full screen cropping display, for normal display CoverImageView it is recommended to use FrameLayout as the parent layout
GSYVideoType.SCREEN_TYPE_FULL = 4;
//Full screen stretching display, when using this attribute, it is recommended to use FrameLayout for surface_container
GSYVideoType.SCREEN_MATCH_FULL = -4;
/***
 * Custom display ratio under SCREEN_TYPE_CUSTOM
 * @param screenScaleRatio Aspect ratio, such as 16:9
 */
public static void setScreenScaleRatio(float screenScaleRatio)


//Switch drawing mode
GSYVideoType.setRenderType(GSYVideoType.SUFRACE);
GSYVideoType.setRenderType(GSYVideoType.GLSURFACE);
GSYVideoType.setRenderType(GSYVideoType.TEXTURE);


//ijk close log
IjkPlayerManager.setLogLevel(IjkMediaPlayer.IJK_LOG_SILENT);


//exoplayer custom MediaSource
ExoSourceManager.setExoMediaSourceInterceptListener(new ExoMediaSourceInterceptListener() {
    @Override
    public MediaSource getMediaSource(String dataSource, boolean preview, boolean cacheEnable, boolean isLooping, File cacheDir) {
        //Customizable MediaSource
        return null;
    }
});

--- More dependency methods, please click -

II. Other Recommendations

* My technical community: Juejin

* QQ group, welcome if interested (usually a lot of chitchat and complaints, because the number of people is saturated, it's just daily nonsense, no one solves problems): ~~

174815284~~ , New group: 992451658 .

* Flutter Github Client , Compose Github Client , React Native Github Client , Weex Github Client , Native Kotlin Github Client

* RxFFmpeg Android audio and video editing tool

* oarplayer Rtmp player, based on MediaCodec and srs-librtmp, does not rely on ffmpeg

* HarmonyOS version openharmony-tpc/GSYVideoPlayer

III. Documentation Wiki

Document Portal
Usage Instructions --- Simple usage, quick start documentation
Recommended Reading --- Basic audio and video knowledge that mobile developers must know 1, --- Basic audio and video knowledge that mobile developers must know 2
Project Analysis Description --- Project analysis description, including project architecture and analysis
API Documentation Entrance --- Usage instructions, API documentation - Entrance
FAQ Entrance --- FAQ - Entrance (most of the problems you encounter are solved here)
Encoding Format --- IJK so file configuration format description
Compile Custom SO --- IJKPlayer Compile Custom SO - Entrance
Version Update Instructions --- Version Update Instructions - Entrance
compileSdk too high --- #3514

Framework diagram Framework diagram2 Framework diagram3 Framework diagram4 Framework diagram5

More visible: https://codewiki.google/github.com/carguo/gsyvideoplayer

IV. Running Effect

The demo now uses a WebVTT thumbnail track for seek preview instead of extracting many frames from the original video on the client. The VTT can point to separate images or sprite coordinates:

WEBVTT

00:00:00.000 --> 00:00:01.000
160p-00001.jpg#xywh=0,0,284,160

Library APIs include GSYVideoPreviewVttParser, GSYVideoPreviewProvider, and GSYVideoPreviewFrame. The app layer loads the frame image and crops the sprite area if needed. See PreViewGSYVideoPlayer#setPreviewVttUrl(String previewVttUrl).

V. Recent Versions

v14.1.0 (2026-11-11)

HTTPS/OpenSSL support is retained. For server authentication, explicitly set FORMAT tls_verify=1 and a trusted ca_file; the default is 0. ARM64/x86_64 use a 16 KiB ELF layout, while ARMv7 keeps 4 KiB. Correct final APK/AAB native-library alignment is also required. See the native-library guide for options, supported inputs, ABI packaging, source pins and matching file hashes.

See the full v14.1.0 changelog for the release scope and verification boundaries.

v14.0.0 (2026-10-10)

See the full v14.0.0 changelog for features, migration and verification scope, and the release audit for all 27 commits and source/artifact mapping.

v13.2.1 (2026-08-19)

v13.2.0 (2026-08-19)

v13.1.0 (2026-06-30)

v13.0.0 (2026-05-07)

v12.1.0 (2026-04-01)

v12.0.0 (2026-03-13)

v11.3.0 (2025-12-05)

v11.2.0 (2025-11-25)

v11.1.0 (2025-08-04)

v11.0.0 (2025-07-10)

More versions, please check: Version Update Instructions

VI. About Issues

Before asking questions, please refer to the documents and instructions above, and reproduce the problem in the Demo.

Problem description:

1. Which page in which Demo.
2. Problem manifestation and reproduction steps.
3. Supplementary video stream url and screenshots of the problem.
4. Supplementary model and Android version of the problem.

VII. Obfuscation

v14.0.0 keeps JNI and reflection entry points rather than entire GSY/Media3 packages. Preserve custom fullscreen/small-window constructors and no-arg player/cache manager constructors. See the FAQ and R8 report.

# ijk JNI: native side reflects back into Java, keep the whole package
-keep class tv.danmaku.ijk.media.player.** { *; }
-dontwarn tv.danmaku.ijk.media.player.**

# ---- Three reflection hotspots inside GSYVideoPlayer, MUST keep ----

# 1) Fullscreen / small-window: GSYBaseVideoPlayer re-instantiates itself via
#    getConstructor(Context[, Boolean]).newInstance()
-keep class * extends com.shuyu.gsyvideoplayer.video.base.GSYBaseVideoPlayer {
    public <init>(android.content.Context);
    public <init>(android.content.Context, java.lang.Boolean);
}

# 2) PlayerFactory instantiates IPlayerManager implementations via Class.newInstance()
-keep class * implements com.shuyu.gsyvideoplayer.player.IPlayerManager {
    public <init>();
}
-keep interface com.shuyu.gsyvideoplayer.player.IPlayerManager { *; }

# 3) CacheFactory instantiates ICacheManager implementations via Class.newInstance()
-keep class * implements com.shuyu.gsyvideoplayer.cache.ICacheManager {
    public <init>();
}
-keep interface com.shuyu.gsyvideoplayer.cache.ICacheManager { *; }

# Media3 aar already ships its own consumer-rules, just silence warnings here
-dontwarn androidx.media3.**
-dontwarn com.google.android.exoplayer2.**

If it is an Alibaba Cloud player, you can refer to its documentation ( https://help.aliyun.com/document_detail/124711.html?spm=a2c4g.124711.0.0.7fa0125dkwUPoU ), you need to add some keep rules:

-keep class com.alivc.**{*;}
-keep class com.aliyun.**{*;}
-keep class com.cicada.**{*;}
-dontwarn com.alivc.**
-dontwarn com.aliyun.**
-dontwarn com.cicada.**

Warm Reminder

If cloning is too slow, you can try downloading from Gitee

Regarding customization and problems, please refer to the FAQ, demo, and issues first.

Learn more about basic audio and video common sense, and understand containers, audio and video encoding, ffmpeg, and the differences in mediacodec.
Try to avoid asking why others can play.

The player is highly customizable. For customization, please refer to the demo and read the source code. There are many functions now, and the demo is constantly being updated.

Some new functions and project structures are also constantly being adjusted.

Welcome to ask questions, thank you.

Dependency Size Reference

It is recommended to use ndk filtering, please refer to Reference 4: 4. NDK so support

Star History Chart

Star History Chart

Warm Reminder

Open source projects mainly provide communication and learning, do not provide technical support, and do not accept business cooperation, purely public interest open source

License

Please refer to the IJKPlayer and AndroidVideoCache related agreements.
The project started from jiecao, and was refactored after some changes.
Occasionally, some variable and method names may still have a shadow of jiaozi, but it is basically a new project.

GSYVideoPlayer (CarGuo/GSYVideoPlayer)

Ищем в базе…

Что это такое?GSYVideoPlayer — это open-source библиотека видеоплеера для Android. Она объединяет несколько движков воспроизведения — IJKPlayer, Media3 (ExoPlayer2), MediaPlayer и AliPlayer — за одним API, а кэширование, данмаку, субтитры, фильтры и поддержка рекламы уже встроены.
Это отдельное приложение-плеер или библиотека, которую я подключаю в свой Android-проект?Это библиотека, а не приложение для конечного пользователя: вы подключаете её как Gradle-зависимость и встраиваете её view плеера и элементы управления в свои layout-файлы. Если хочется просто попробовать результат, есть демо-APK.
Как подключить её к своему приложению?Добавьте её как Gradle-зависимость в build.gradle вашего модуля — с версии v11.0.0 библиотека размещена на MavenCentral (рекомендуемый способ). Ещё работает GitHub Packages, но там нужен токен с правом read:packages, а Jitpack публикацию не прекратил, хотя иногда случайно теряет пакеты.
Какие движки воспроизведения она использует — мне нужно самому ставить ExoPlayer или FFmpeg?Нет, все движки встроены и переключаются в коде через PlayerFactory.setPlayManager(...): IJKPlayer (по умолчанию), Media3/ExoPlayer2, системный MediaPlayer и AliPlayer. В режиме IJK поддержка форматов построена на FFmpeg — работают rtmp, rtsp, hls и другие.
Есть ли подводные камни при выборе варианта зависимости?Да. Варианты по умолчанию (A/B) воспроизводят h263/264/265, но mpeg-видео даёт только звук без картинки — вариант C добавляет поддержку mpeg, rtsp, concat, crypto и размера страницы 16K ценой большего размера .so. Дополнительный модуль Compose также требует JDK 17 или новее.
Это только для Android?Да, это библиотека для Android. Существует отдельный порт для HarmonyOS в репозитории openharmony-tpc/GSYVideoPlayer.
Поддерживается ли просмотр во время кэширования?Да. Прокси-кэш (AndroidVideoCache) работает со всеми движками, кроме m3u8; в режиме Media3/ExoPlayer вместо него используется SimpleCache, который поддерживает m3u8 и по умолчанию держит кэш 512 МБ — размер можно увеличить через ExoSourceManager.setCacheMaxSize.
Какие возможности воспроизведения работают сразу из коробки?Плейлист с автопрокруткой при пролистывании, несколько одновременных воспроизведений, маленькие плавающие окна, рекламные ролики до и посреди видео с возможностью пропуска, более 20 фильтров, водяные знаки, захват кадров и конвертация видео в GIF, управление скоростью, поворот, переключение качества между несколькими URL, адаптивные дорожки HLS/DASH и плавный переход из списка в подробный просмотр.
Как здесь устроены субтитры и данмаку?Единый оверлей внешних субтитров поддерживает SRT и WebVTT для IJK, Media3 и MediaPlayer, а встроенные субтитры Media3 передаются в тот же интерфейс. Данмаку (сообщения поверх видео) встроена в виде слоя с бегущими комментариями, который можно наследовать и настраивать под себя.
Можно ли настроить внешний вид и поведение плеера?Да — есть наборы layout для полноэкранного и оконного режимов, режим чистого воспроизведения без элементов управления, а слои рендеринга, управления, плеера и кэша можно заменять своими. Дополнительный модуль gsyvideoplayer-cast добавляет трансляцию через DLNA/UPnP.
Какие есть похожие проекты?MaterialDrawer, Levyra-deepsound, animeko, hls.js, DPlayer, material-components-android, BBLL, video.js
Автор
CarGuo
Размер
524.7 MB
Звёзды
21.5K
Возраст
10 г
Коммиты · 90 дней