西瓜播放器 HTML5 video video.js 播放器 HTML5播放器 mp4 hls hls.js flv flv.js dash dash.js 无缝切换

Plugins for third-party librarys

xgplayer-flv.js

A extension plugin which integrated hls.js based on xgplayer, it can support play hls video

install

NPM

$ npm install xgplayer
$ npm install xgplayer-flv.js

CDN

const FlvJsPlugin = window.FlvJsPlugin

Usage

html

  <div id="vs"></div>

js

import Player from 'xgplayer'
import 'xgplayer/dist/index.min.css'
import FlvJsPlugin from 'xgplayer-flv.js'

const player = new Player({
        id: 'vs',
        url: '../xgplayer-demo.hls',
        plugins: [FlvJsPlugin],
        flvJsPlugin: {} // config for plugin FlvJsPlugin
        // If use CDN loading,you can Get the plugin through window.FlvJsPlugin
    })

xgplayer-hls.js

A extension plugin which integrated hls.js based on xgplayer

install

NPM

$ npm install xgplayer
$ npm install xgplayer-hls.js

CDN

const HlsJsPlugin = window.HlsJsPlugin

Usage

html

  <div id="vs"></div>

js

import Player from 'xgplayer'
import 'xgplayer/dist/index.min.css'
import HlsJsPlugin from 'xgplayer-hls.js'

const player = new Player({
        id: 'vs',
        url: '../xgplayer-demo.hls',
        plugins: [HlsJsPlugin],
        hlsJsPlugin: {} // config for plugin HlsJsPlugin
    })

xgplayer-dash

A extension plugin based on xgplayer, it can support play dash video

install

NPM

$ npm install xgplayer
$ npm install xgplayer-dash

CDN

const DashPlugin = window.DashPlugin

Usage

html

  <div id="vs"></div>

js

import Player from 'xgplayer'
import 'xgplayer/dist/index.min.css'
import DashPlugin from 'xgplayer-dash'

const player = new Player({
        id: 'vs',
        url: '../xgplayer-demo.hls',
        plugins: [DashPlugin],
        DashPlugin: {} // config for plugin DashPlugin
    })

xgplayer-shaka

A extension plugin which integrated shaka-player based on xgplayer

install

NPM

$ npm install xgplayer
$ npm install xgplayer-shaka

CDN

const ShakaPlugin = window.ShakaPlugin

Usage

html

  <div id="vs"></div>

js

import Player from 'xgplayer'
import 'xgplayer/dist/index.min.css'
import ShakaPlugin from 'xgplayer-shaka'

const player = new Player({
    id: 'vs',
    url: '../xgplayer-demo.hls',
    plugins: [ShakaPlugin],
    shakaPlugin: {} // config for plugin ShakaPlugin
})