From 345fa2246346e437e94a6dd7323a913cd7ecd5b0 Mon Sep 17 00:00:00 2001 From: sfchu Date: Sun, 15 Jun 2025 10:59:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/AVPlayer.ets | 7 +++++-- entry/src/main/ets/pages/VideoPlay.ets | 1 + entry/src/main/ets/pages/WindowPip.ets | 2 ++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/pages/AVPlayer.ets b/entry/src/main/ets/pages/AVPlayer.ets index 789d18d..308d93d 100644 --- a/entry/src/main/ets/pages/AVPlayer.ets +++ b/entry/src/main/ets/pages/AVPlayer.ets @@ -19,8 +19,10 @@ import { common } from '@kit.AbilityKit'; import { media } from '@kit.MediaKit'; import { Constants } from '../constants/Constants'; import Logger from '../utils/Logger'; + const uiContext: UIContext | undefined = AppStorage.get('uiContext'); let UIContext = uiContext!.getHostContext()!; + export class AVPlayer { private avPlayer?: media.AVPlayer; // The surfaceID is used to display the screen. @@ -71,7 +73,7 @@ export class AVPlayer { } this.State = state; switch (state) { - // After the RESET API is successfully called, the state machine is triggered. + // After the RESET API is successfully called, the state machine is triggered. case Constants.idle_STATUS: Logger.info('AVPlayer state idle called.'); if (!this.jumpNext) { @@ -162,7 +164,8 @@ export class AVPlayer { } play() { - if ((this.State === Constants.PAUSED_STATUS || this.State === Constants.PREPARED_STATUS) && this.playStatus === true) { + if ((this.State === Constants.PAUSED_STATUS || this.State === Constants.PREPARED_STATUS) && + this.playStatus === true) { this.avPlayer?.play(); } } diff --git a/entry/src/main/ets/pages/VideoPlay.ets b/entry/src/main/ets/pages/VideoPlay.ets index 20cda19..93bc8bb 100644 --- a/entry/src/main/ets/pages/VideoPlay.ets +++ b/entry/src/main/ets/pages/VideoPlay.ets @@ -22,6 +22,7 @@ import Logger from '../utils/Logger'; const TAG = Constants.NAV_DESTINATION_NAME; const uiContext: UIContext | undefined = AppStorage.get('uiContext'); let UIContext = uiContext!.getHostContext()!; + @Extend(Text) function textType() { .padding({ left: $r('app.integer.other_padding') }) diff --git a/entry/src/main/ets/pages/WindowPip.ets b/entry/src/main/ets/pages/WindowPip.ets index 6243b3a..a8dd039 100644 --- a/entry/src/main/ets/pages/WindowPip.ets +++ b/entry/src/main/ets/pages/WindowPip.ets @@ -16,8 +16,10 @@ import { Constants } from '../constants/Constants'; import { PlayVideo } from './VideoPlay'; import Logger from '../utils/Logger'; + const uiContext: UIContext | undefined = AppStorage.get('uiContext'); let UIContext = uiContext!.getHostContext()!; + @Component struct ImageWidthTitle { @State imageHeight: number = 0; -- Gitee