From cabfdd76090d5c149631464eb9db46ee90201d63 Mon Sep 17 00:00:00 2001 From: "chenrui.92__dcar" Date: Thu, 24 Oct 2024 17:42:14 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B(xgplayer)=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E8=B0=83=E7=94=A8definition=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E7=9A=84changeDefinitionList=E6=96=B9=E6=B3=95=E5=90=8E?= =?UTF-8?q?=E5=86=85=E9=83=A8=E8=BF=98=E6=98=AF=E4=BD=BF=E7=94=A8=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=AE=9A=E4=B9=89=E7=9A=84definition.list=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/xgplayer/src/plugins/definition/index.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/xgplayer/src/plugins/definition/index.js b/packages/xgplayer/src/plugins/definition/index.js index a0b8d1e7c..129971811 100644 --- a/packages/xgplayer/src/plugins/definition/index.js +++ b/packages/xgplayer/src/plugins/definition/index.js @@ -134,6 +134,11 @@ export default class DefinitionIcon extends OptionsIcon { if (!Array.isArray(list)) { return } + + if (this.player.config.definition) { + this.player.config.definition.list = list + } + this.config.list = list.map(item => { if (!item.text && item.name) { item.text = item.name @@ -152,7 +157,7 @@ export default class DefinitionIcon extends OptionsIcon { } onItemClick (e, data) { - const { definitionList } = this.player + const { list: definitionList } = this.config super.onItemClick(...arguments) this.emitUserAction(e, 'change_definition', { from: data.from, to: data.to }) for (let i = 0; i < definitionList.length; i++) {