Skip to content

Commit

Permalink
fix: 🐛 (xgplayer) 修复弹幕插件在无controls时,初始化报错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
gemxx committed May 22, 2024
1 parent 077335d commit dd6356e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/xgplayer/src/plugins/danmu/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -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) => {
Expand Down

0 comments on commit dd6356e

Please sign in to comment.