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

内置插件icons配置

可配置图标列表

key说明所属插件
play播放iconplay
pause暂停iconplay
playNext播放下一个iconplaynext
replay重播iconreplay
rotate旋转iconrotate
startPlay(播放器中央)启动播放iconstart
startPause(播放器中央)播放暂停iconstart
volumeSmall音量icon(小)volume
volumeLarge音量icon(大)volume
volumeMuted音量icon(静音)volume
openDanmu弹幕icon(开)danmu
closeDanmu弹幕icon(关)danmu
download下载icondownload
screenshotIcon截图iconscreenshot
fullscreen全屏iconfullscreen
exitFullscreen退出全屏iconfullscreen
screenBack左上角退出全屏icon,移动端专用fullscreen
cssFullscreen页面全屏按钮iconcssfullscreen
exitCssFullscreen退出页面全屏按钮iconcssfullscreen
pipIcon进入画中画pip
pipIconExit退出画中画pip
loadingIcon加载中loading

通过playerConfig替换

import Player, {Util} from 'xgplayer'
const playerConfig = {
  ...,
  icons: {
    play: () => {
      const dom = Util.createDom('div', '<img src="./start"/>', {}, 'customclass')
      return dom
    },// 通过function方式 返回一个dom
    pause: `<div class='customclass'><img src="./start"/></div>` // 直接html代码
  }
}