From 763cc2b98e6b1acb357a8a2a5f7017edf8611478 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B9=90=E5=A4=9A?= Date: Wed, 21 Aug 2024 12:05:45 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=92=AD=E6=94=BE=E8=A7=86?= =?UTF-8?q?=E9=A2=91=E4=BC=9A=E8=87=AA=E5=8A=A8=E6=81=AF=E5=B1=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98=20Signed-off-by:=20yangsai=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/components/videoplayer/VideoPlayerApiImpl.ets | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/video_player/video_player_ohos/ohos/src/main/ets/components/videoplayer/VideoPlayerApiImpl.ets b/packages/video_player/video_player_ohos/ohos/src/main/ets/components/videoplayer/VideoPlayerApiImpl.ets index 69437d5ce..2dbe3df55 100644 --- a/packages/video_player/video_player_ohos/ohos/src/main/ets/components/videoplayer/VideoPlayerApiImpl.ets +++ b/packages/video_player/video_player_ohos/ohos/src/main/ets/components/videoplayer/VideoPlayerApiImpl.ets @@ -36,6 +36,8 @@ import resourceManager from '@ohos.resourceManager'; import common from '@ohos.app.ability.common'; import { media } from '@kit.MediaKit'; import { EventChannel } from '@ohos/flutter_ohos'; +import { GlobalContext } from './util/GlobalContext'; +import { window } from '@kit.ArkUI'; const TAG: string = "VideoPlayerApiImpl"; export class VideoPlayerApiImpl { @@ -67,6 +69,8 @@ export class VideoPlayerApiImpl { } async create(arg: CreateMessage): Promise { + let windowClass = await window.getLastWindow(this.getContext()) + GlobalContext.getContext().setObject("windowClass", windowClass) Log.i(TAG, "enter create"); if (this.flutterState == null) { throw new Error("Illegal flutterState null."); -- Gitee