# xgplayer
**Repository Path**: anydev/xgplayer
## Basic Information
- **Project Name**: xgplayer
- **Description**: 一款由字节跳动开源的 Web 视频播放器。它基于组件化的原则设计了独立的、可拆分的 UI 组件。更重要的是,它不仅在 UI 层面上灵活,还在功能上进行了大胆的改进:它摆脱了对视频加载、缓冲和格式支持的依赖。尤其在处理 mp4 格式时,它可以进行分段加载,即使不支持流式传输的 mp4 格式也能实现无缝切换、加载控制和节省流量。它还集成了对 FLV、HLS 和 dash 格式的点播和直播支持。
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: 1102-判断ios平板的方法希望区分mac和ipad13xx
- **Homepage**: https://h5player.bytedance.com/
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2025-08-02
- **Last Updated**: 2025-08-02
## Categories & Tags
**Categories**: Uncategorized
**Tags**: None
## README
### Introduction
xgplayer is a web video player library. It has designed a separate, detachable UI component based on the principle that everything is componentized. More importantly, it is not only flexible in the UI layer, but also bold in its functionality: it gets rid of video loading, buffering, and format support for video dependence. Especially on mp4
it can be staged loading for that does not support streaming mp4. This means seamless switching with clarity, load control, and video savings. It also integrates on-demand and live support for FLV, HLS, and dash. [Document](http://h5player.bytedance.com/en/)
### Start
1. Install
```bash
$ npm install xgplayer
```
2. Usage
Step 1:
```html
```
Step 2:
```js
import Player from 'xgplayer';
const player = new Player({
id: 'vs',
url: 'http://s2.pstatp.com/cdn/expire-1-M/byted-player-videos/1.0.0/xgplayer-demo.mp4'
})
```
This is the easiest way to configure the player, then it runs with video. For more advanced content, see the plug-in section or documentation. [more config](http://h5player.bytedance.com/en/config/)
### Plugins
xgplayer provides more plugins and supports custom plugins, for more content viewing [plugins](http://h5player.bytedance.com/en/plugins/). There are many built-in plugins in the player, if you need to close specific plugins, you can disable them by [ignores](https://h5player.bytedance.com/config/#ignores) configuration
### Dev
In order to debug by developers, we provide demos code in the fixtures directory of the repo. The player uses yarn for package management, and it only takes a few simple steps to start debugging in the repo
```bash
$ cd xgplayer
$ yarn
$ yarn dev:xgplayer
```
To debug other plugins, please refer to the scripts command provided in package.json in the root directory of the repo, such as:
```bash
$ yarn dev:hls
$ yarn dev:flv
$ yarn dev:mp4
```
### License
Welcome to use xgplayer! Please read the following terms carefully. Using xgplayer means that you accept and agree to the terms.
1. Xgplayer is licensed under the [MIT](http://opensource.org/licenses/MIT) License. You comply with its obligations by default.
2. By default, you authorize us to place your logo in xgplayer website, which using xgplayer.
If you have any problem, please let us know.