{"id":20958519,"url":"https://github.com/junixapp/livegiftplayer","last_synced_at":"2025-08-03T03:10:52.615Z","repository":{"id":108524537,"uuid":"410955944","full_name":"junixapp/LiveGiftPlayer","owner":"junixapp","description":"直播礼物特效播放器，支持MP4(支持4个方向的透明通道)和WEBP。","archived":false,"fork":false,"pushed_at":"2021-10-14T13:12:19.000Z","size":17433,"stargazers_count":26,"open_issues_count":1,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-02T14:02:15.485Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/junixapp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2021-09-27T16:13:31.000Z","updated_at":"2025-03-18T14:26:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7598928-1431-4d38-86b1-d94f9e8e6585","html_url":"https://github.com/junixapp/LiveGiftPlayer","commit_stats":null,"previous_names":["junixapp/livegiftplayer"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FLiveGiftPlayer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FLiveGiftPlayer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FLiveGiftPlayer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/junixapp%2FLiveGiftPlayer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/junixapp","download_url":"https://codeload.github.com/junixapp/LiveGiftPlayer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254084695,"owners_count":22011924,"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":[],"created_at":"2024-11-19T01:48:02.035Z","updated_at":"2025-05-14T06:32:17.415Z","avatar_url":"https://github.com/junixapp.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LiveGiftPlayer\n直播礼物特效播放器，支持MP4(支持4个方向的透明通道)和WEBP。\n\n# 特色\n- 队列播放\n- 支持4个方向的透明通道的MP4文件\n- 支持WEBP格式\n- 实现Lifecycle自动释放资源\n\n# 效果\n![](img/demo.gif)\n\n# 依赖\n\n[![](https://jitpack.io/v/li-xiaojun/LiveGiftPlayer.svg)](https://jitpack.io/#li-xiaojun/LiveGiftPlayer)\n```\nimplementation 'com.github.li-xiaojun:LiveGiftPlayer:版本号'\n```\n\n# 使用\n1. 构造GiftPlayItem\n```kotlin\ndata class GiftPlayItem(\n    var path: String,  //文件路径\n    var fileType: GiftFileType, //礼物文件类型\n    var alphaPosition: AlphaPosition? = null //透明通道位置，MP4类型需要传\n)\n```\n\n2. 播放\n```kotlin\nLiveGiftPlayer.play(lifecycleOwner, giftItem, giftContainer)\n```\n\n3. 监听\n```kotlin\nLiveGiftPlayer.playCallback = object : LiveGiftPlayer.PlayCallback{\n    override fun onStart(gift: GiftPlayItem) {\n        findViewById\u003cTextView\u003e(R.id.tvInfo).text = \"开始播放 ${gift.path} 透明通道：${gift.alphaPosition}\"\n    }\n\n    override fun onEnd(gift: GiftPlayItem) {\n        findViewById\u003cTextView\u003e(R.id.tvInfo).text = \"播放结束 ${gift.path} 透明通道：${gift.alphaPosition}\"\n    }\n\n}\n```\n\n# 注意\n1. WEBP格式动画在低端机性能较低，可能会出现卡顿现象","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunixapp%2Flivegiftplayer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjunixapp%2Flivegiftplayer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjunixapp%2Flivegiftplayer/lists"}