bytedance /xgplayer
A HTML5 video player with a parser that saves traffic
★ 9,310⑂ 948👁 116⑃ 735● 1,184▤ 29
More from this author
+0
Daily
+1
Weekly
+5
Monthly
9,310
stars
948
forks
116
watchers
735
prs
1,184
issues
29
releases
README
xgplayer
xgplayer provides a flexible, plugin-based media player for web applications.
Its UI components, loading strategies, and format integrations can be composed
independently.
Documentation
Installation
bash
npm install xgplayer
Usage
html
js
import Player from 'xgplayer'
import 'xgplayer/dist/index.min.css'
const player = new Player({
id: 'player',
url: 'https://s2.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/xgplayer-demo.mp4'
})
See the configuration documentation
for additional player options.
Plugins
xgplayer provides built-in UI plugins and optional streaming or feature
packages. See the plugin documentation
for available integrations.
Development
The repository uses Yarn 1.x. Fixture commands start local demos for each
format:
bash
yarn
yarn dev:xgplayer
bash
yarn dev:hls
yarn dev:flv
yarn dev:mp4
Release
See the release guideline for stable and
prerelease workflows.
License
By using xgplayer, you agree to the following terms:
1. xgplayer is licensed under the MIT License.
2. You authorize the xgplayer project to display the logo of a business using
xgplayer on the project website.Top issues
#1965ios safari浏览器存在重复拉取第一个视频流ts的情况4 comments · 2026-10-20#1810vue环境设置"fluid": true直播正常显示,uniapp环境下"fluid": true直播无法显示4 comments · 2025-07-25#1873ios系统视频播放错误时,页面黑屏显示只在页面中间显示了一个不能播放的图标3 comments · 2025-12-15#1845西瓜播放器在模仿mkv格式的资源时,如何读取视频内的音轨和字幕资源?3 comments · 2025-10-11#1820ios 移动模式 cssfullscreen 时,必须双击暂停,才可以操作控制栏3 comments · 2025-08-17#1938iOS系统17及以下版本播放m3u8的hls格式视频后频繁点击暂停播放后突然出现重新开始的视频声音,但没有画面2 comments · 2026-08-19#1871是否有计划支持ws://*.mp4播放2 comments · 2025-12-09#1869iOS26在使用xgplayer-hls.js插件后 无法显示投屏(airplay)按钮 不添加插件是可以的2 comments · 2025-12-04
Discussions
#1803Will you be using typescript ?1 comments · 2025-07-17#1722v3版本如何自定义样式?0 comments · 2025-03-08#1617How to understand the relationship between xgplayer-transmuxer and xgplayer-mp4-loader0 comments · 2024-09-24#1610Can xgplayer-mp4-loader isFragmentMP4 split into isFragmentMP4 + hasSegmentIndex?0 comments · 2024-09-15#1589是否有min.js精简引入?0 comments · 2024-08-29#1558在播放器中使用清晰度按钮 流可以正常切换 但是按钮的中文不变 flv的直播流1 comments · 2024-08-08#1539你好,开发者可以不可以增加一个互斥功能呢,这个比较有用。0 comments · 2024-07-23#1395在react中怎么使用事件操作0 comments · 2024-04-20
Latest release
v3.0.27 v3.0.27 2026-10-293.0.27 (2026-10-28) Features - mp3: Add standalone MP3 MSE playback with Range seek and native fallback. (65f8649) - mp4: xgplayer-mp4 can now play on MSE/ManagedMediaSource (iOS 17.1+) via preferMMS, instead of always degrading to native video. (322888e), closes 1932 - range请求,增加 数据范围是否匹配检测 (03a109c) - support dynamic-timeout timeoutRatio, xhr fix endless request because of unpected net response (2c89a2c) - 优化range请求时,返回200状态码问题 (e43c93b) Bug Fixes - dash: parse MPD durations with any combination of H, M and S (f9c8ad2) - hls: preserve playlist path for query-only URIs (5af9e7d) - hls: