百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
G

GiraffePlayer2

> 开发工具
开源

出厂安装的 Android 视频播放器(支持懒加载、ListView/RecyclerView 和高性能)

374 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

出厂安装的 Android 视频播放器(支持懒加载、ListView/RecyclerView 和高性能)

GiraffePlayer2

Out of the box android video player base on ijkplayer 0.8.8 (for flutter please visit GPlayer)

this project is total refactor of GiraffePlayer to support in ListView/RecyclerView and improve the performance,all player tasks do in worker thread.

release history

download demo apk (~700kb)

features

  1. base on ijkplayer,support RTMP , HLS (http & https) , MP4,M4A etc.
  2. gestures for volume control
  3. gestures for brightness control
  4. gestures for forward or backward
  5. fullscreen by manual or sensor (with animation)
  6. try to replay when error(only for live video)
  7. specify video scale type
  8. support in ListView/RecyclerView (in Activity or Fragment)
  9. never block UI thread
  10. support select track
  11. support float window
  12. support lazy load (download player on demand,increase apk size only about 180K)
  13. easy to custom media controller (without change this project source code)

how to import library

gradle
   //step 1: add jcenter repositories in your root poject build file
   repositories {
       ...
       jcenter()
   }

   //step 2: add dependency,there are 3 type of aar,see the flow table
   api 'com.github.tcking:giraffeplayer2:0.1.25-lazyLoad'
aar type aar size decoders support abi
api 'com.github.tcking:giraffeplayer2:0.1.25' 2.2M common decoders default armeabi,can add manually
api 'com.github.tcking:giraffeplayer2:0.1.25-lazyLoad' 180K all decoders download player(so files) on demand by device abi
api 'com.github.tcking:giraffeplayer2:0.1.25-full' 5.4M all decoders default armeabi,can add manually

if you using compile 'com.github.tcking:giraffeplayer2:0.1.25' or compile 'com.github.tcking:giraffeplayer2:0.1.25-full' and want to support more ABI:

…

How to use (example code)

case 1: only want to play a video fullscreen

just call GiraffePlayer.play(getContext(), new VideoInfo("video url"));,all is done.

case 2: embed a player in a layout (ListView/RecyclerView)

step 1: add VideoView in your layout xml file

xml

step 2: get player and play

java

VideoView videoView = (VideoView) findViewById(R.id.video_view);
videoView.setVideoPath(videoUri).getPlayer().start();

player in ListView or RecyclerView example code

in ListView or RecyclerView,you need do one more thing: call videoView.setFingerprint(), the fingerprint is the key that player distinguish list items,you can using list position or list data's hashcode as fingerprint,eg:

java
public void onBindViewHolder(VideoItemHolder holder, int position) {
        VideoItem videoItem = data.get(position);
        holder.name.setText(videoItem.name);
        holder.url.setText(videoItem.uri);
        holder.videoView.setVideoPath(videoItem.uri).setFingerprint(position);// or using:setFingerprint(videoItem.hashCode())
    }

config player

all the configurations in VideoInfo,you can get VideoInfo and then set configurations,eg:

…

Proguard Configurationr

-dontwarn tv.danmaku.ijk.media.player.**
-keep class tv.danmaku.ijk.media.player.** { *; }
-keep interface tv.danmaku.ijk.media.player.* { *; }

screenshot

lazy load

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaandroidffmpegfullscreengesture

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具