fix: 🐛 (xgplayer) 修复弹幕插件在无controls时,初始化报错问题

This commit is contained in:
gemstone 2024-05-21 17:00:13 +08:00
parent 077335d919
commit dd6356e95d

View File

@ -167,7 +167,7 @@ class Danmu extends Plugin {
registerExtIcons () {
const { player, config } = this
if (config.panel) {
if (config.panel && player.controls) {
const panelOptions = {
config: {
onChangeset: (set) => {
@ -178,7 +178,7 @@ class Danmu extends Plugin {
this.danmuPanel = player.controls.registerPlugin(DanmuPanel, panelOptions, DanmuPanel.pluginName)
}
const { switchConfig } = config
if (!config.closeDefaultBtn) {
if (!config.closeDefaultBtn && player.controls) {
const buttonOptions = {
config: {
onSwitch: (event, isOpen) => {