Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
X

xgplayer

> 前端框架
Open source

A HTML5 video player with a parser that saves traffic

9.3K stars0 likes3 views
WebsiteGitHub

About

A HTML5 video player with a parser that saves traffic

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

Start

  1. Install

    bash
    $ npm install xgplayer
  2. Usage

    Step 1:

    xml
    
    

    Step 2:

    javascript
    import Player from 'xgplayer';
    
    const player = new Player({
        id: 'vs',
        url: 'https://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

Plugins

xgplayer provides more plugins and supports custom plugins, for more content viewing plugins. There are many built-in plugins in the player, if you need to close specific plugins, you can disable them by 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

Release

For the stable release flow, prerelease flow, and release commands, see Release Guideline.md.

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 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.

Issues· 45 open

View all issuesOpen on GitHub
  • #1947

    English documentation API navigation links to a 404 route

    Updated Sep 18, 2026
  • #1951

    mp4插件官方文档使用案例错误

    Updated Sep 11, 2026
  • #1949

    [Bug] v3 在部分触摸大屏仅派发 Pointer Events 时进度条无法拖动

    Updated Sep 1, 2026
  • #1945

    MSE unbind leaks its object URL before sourceopen

    Updated Aug 22, 2026
  • #1943

    XhrLoader ignores the transformResponse option

    Updated Aug 22, 2026
  • #1941

    Range loaders accept mismatched Content-Range responses by default

    Updated Aug 22, 2026
  • #1936

    BUG:在部分安卓webview中出现视频播放结束时出现长时间loading然后从mse降级到video播放

    Updated Aug 22, 2026
  • #1938

    iOS系统17及以下版本播放m3u8的hls格式视频后频繁点击暂停播放后突然出现重新开始的视频声音,但没有画面

    Updated Aug 19, 2026
  • #1935

    bug

    Updated Aug 5, 2026
  • #1932

    xgplayer-mp4 有支持IOS的计划吗,MSE或MMS方案,非降级方案

    Updated Jul 31, 2026

> Tags

JavaScriptdashflvflv-parserfmp4

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 29, 2026
Category前端框架
PricingOpen source

> Related tools

R
React
用于构建用户界面的 JavaScript 库
V
Vue.js
渐进式 JavaScript 框架
N
Next.js
基于 React 的全栈 Web 框架