bytedance /xgplayer

A HTML5 video player with a parser that saves traffic

★ 9,310⑂ 948👁 116⑃ 735● 1,184▤ 29
JavaScriptMITCreated 2018-05-16h5player.bytedance.com/
Download: v3.0.27v3.0.27 ↓3.0.272026-10-29
+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

Discussions

Latest release

v3.0.27 v3.0.27 2026-10-29
3.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: 

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON