内置插件icons配置
可配置图标列表
key | 说明 | 所属插件 |
---|---|---|
play | 播放icon | play |
pause | 暂停icon | play |
playNext | 播放下一个icon | playnext |
replay | 重播icon | replay |
rotate | 旋转icon | rotate |
startPlay | (播放器中央)启动播放icon | start |
startPause | (播放器中央)播放暂停icon | start |
volumeSmall | 音量icon(小) | volume |
volumeLarge | 音量icon(大) | volume |
volumeMuted | 音量icon(静音) | volume |
openDanmu | 弹幕icon(开) | danmu |
closeDanmu | 弹幕icon(关) | danmu |
download | 下载icon | download |
screenshotIcon | 截图icon | screenshot |
fullscreen | 全屏icon | fullscreen |
exitFullscreen | 退出全屏icon | fullscreen |
screenBack | 左上角退出全屏icon,移动端专用 | fullscreen |
cssFullscreen | 页面全屏按钮icon | cssfullscreen |
exitCssFullscreen | 退出页面全屏按钮icon | cssfullscreen |
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代码
}
}