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

download

Download plugin。SourceCode

pluginName: download

The plugin is hidden by default, if you need to enable it, you can configuration playerConfig as follows:

const player = new Player({
  ...,
  download: true
})

// OR

const player = new Player({
  ...,
  download: {
    disable: false,
    ... // Other configuration items
  }
})

TIP

This plugin uses the downloadjs to realize the download function. Based on the principle implemented by this open source plugin, xgplayer cannot provide unified download progress events. If you have strong business needs, you can refer to downloadjs xmlHttpRequest logic to implement a custom download plugin

config

position

  • @type: String
  • default: POSITIONS.ROOT_RIGHTFor specific enumeration values, please see plugin-positions

The plugin Dom mount location

index

  • @type: Number
  • default: 3

display order in controlBar

disable

  • @type: Boolean
  • default: true

Whether to disable, Default true

该配置项可通过playerConfig.download设置布尔值控制,默认值是false, 例如:

const playerConfig = {
  download: true //显示下载按钮
  ...
}