From 67d76e86132cc7324c9040132c7d33688de88040 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Wed, 10 Sep 2025 09:59:31 +0800 Subject: [PATCH 1/3] change --- entry/src/main/ets/views/ScaleDialog.ets | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/entry/src/main/ets/views/ScaleDialog.ets b/entry/src/main/ets/views/ScaleDialog.ets index 082f4aa..9d0b477 100644 --- a/entry/src/main/ets/views/ScaleDialog.ets +++ b/entry/src/main/ets/views/ScaleDialog.ets @@ -49,7 +49,8 @@ export struct ScaleDialog { ListItem() { Column() { Row() { - Text(item)// [StartExclude text_style2] + Text(item) + // [StartExclude text_style2] .fontSize($r('app.float.size_16')) .fontColor(Color.Black) .fontWeight(FontWeight.Medium) @@ -57,7 +58,8 @@ export struct ScaleDialog { // [EndExclude text_style2] Blank() Image(this.windowScaleSelect === index ? $r('app.media.ic_radio_selected') : - $r('app.media.ic_radio'))// [StartExclude text_style3] + $r('app.media.ic_radio')) + // [StartExclude text_style3] .width($r('app.float.size_24')) .height($r('app.float.size_24')) .objectFit(ImageFit.Contain) @@ -65,7 +67,6 @@ export struct ScaleDialog { } // [StartExclude text_style4] .width('100%') - if (index != this.scaleList.length - ONE) { Divider() .vertical(false) -- Gitee From e14bf0fa8401d12a260c06a7b921c07c45e25a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Wed, 10 Sep 2025 10:03:14 +0800 Subject: [PATCH 2/3] change --- entry/src/main/ets/views/ScaleDialog.ets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/entry/src/main/ets/views/ScaleDialog.ets b/entry/src/main/ets/views/ScaleDialog.ets index 9d0b477..91ff6a7 100644 --- a/entry/src/main/ets/views/ScaleDialog.ets +++ b/entry/src/main/ets/views/ScaleDialog.ets @@ -50,21 +50,26 @@ export struct ScaleDialog { Column() { Row() { Text(item) + // DocsDot // [StartExclude text_style2] .fontSize($r('app.float.size_16')) .fontColor(Color.Black) .fontWeight(FontWeight.Medium) .textAlign(TextAlign.Center) // [EndExclude text_style2] + // DocsDot Blank() Image(this.windowScaleSelect === index ? $r('app.media.ic_radio_selected') : $r('app.media.ic_radio')) + // DocsDot // [StartExclude text_style3] .width($r('app.float.size_24')) .height($r('app.float.size_24')) .objectFit(ImageFit.Contain) // [EndExclude text_style3] + // DocsDot } + // DocsDot // [StartExclude text_style4] .width('100%') if (index != this.scaleList.length - ONE) { @@ -76,6 +81,7 @@ export struct ScaleDialog { .width('100%') } // [EndExclude text_style4] + // DocsDot } .width('90%') } -- Gitee From f40d07ba873af978c929a2bf3498acee96fcdd47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E9=9B=AA=E8=8E=B9?= <1799939623@qq.com> Date: Wed, 10 Sep 2025 10:12:26 +0800 Subject: [PATCH 3/3] change --- .../ets/controller/AvPlayerController.ets | 6 ++++ entry/src/main/ets/views/LanguageDialog.ets | 34 +++++++++++-------- entry/src/main/ets/views/SpeedDialog.ets | 12 +++++-- 3 files changed, 36 insertions(+), 16 deletions(-) diff --git a/entry/src/main/ets/controller/AvPlayerController.ets b/entry/src/main/ets/controller/AvPlayerController.ets index 9456c4c..585bfbd 100644 --- a/entry/src/main/ets/controller/AvPlayerController.ets +++ b/entry/src/main/ets/controller/AvPlayerController.ets @@ -184,6 +184,7 @@ export class AvPlayerController { return; } switch (state) { + // DocsDot // [StartExclude state] case 'idle': // This state machine is triggered after the reset interface is successfully invoked. hilog.info(CommonConstants.LOG_DOMAIN, TAG, 'setAVPlayerCallback AVPlayer state idle called.'); @@ -197,10 +198,12 @@ export class AvPlayerController { this.avPlayer.prepare(); break; // [EndExclude state] + // DocsDot case 'prepared': // This state machine is reported after the prepare interface is successfully invoked. hilog.info(CommonConstants.LOG_DOMAIN, TAG, 'setAVPlayerCallback AVPlayer state prepared called.'); this.isReady = true; this.avPlayer.loop = true + // DocsDot // [StartExclude prepared] this.durationTime = this.avPlayer.duration; this.currentTime = this.avPlayer.currentTime; @@ -226,7 +229,9 @@ export class AvPlayerController { this.setVideoSpeed(); // [EndExclude prepared] + // DocsDot break; + // DocsDot // [StartExclude other_state] case 'playing': // After the play interface is successfully invoked, the state machine is reported. hilog.info(CommonConstants.LOG_DOMAIN, TAG, 'setAVPlayerCallback AVPlayer state playing called.'); @@ -260,6 +265,7 @@ export class AvPlayerController { hilog.info(CommonConstants.LOG_DOMAIN, TAG, 'setAVPlayerCallback AVPlayer state unknown called.'); break; // [EndExclude other_state] + // DocsDot } }); // [End loop_playback] diff --git a/entry/src/main/ets/views/LanguageDialog.ets b/entry/src/main/ets/views/LanguageDialog.ets index aa88125..9fe6e4a 100644 --- a/entry/src/main/ets/views/LanguageDialog.ets +++ b/entry/src/main/ets/views/LanguageDialog.ets @@ -18,7 +18,6 @@ import { AvPlayerController } from '../controller/AvPlayerController'; // Index of the playback rate list. const ONE = 1; -// [Start video_language_dialog] /** * Set language dialog */ @@ -26,40 +25,51 @@ const ONE = 1; export struct LanguageDialog { @State languageList: Resource[] = [$r('app.string.Chinese'), $r('app.string.English')]; - @Link languageSelect: number; // Index of the current selection + @Link @Watch('onLanguageSelectUpdate') languageSelect: number; // Index of the current selection @StorageLink('avPlayerController') avPlayerController: AvPlayerController = new AvPlayerController(); private controller: CustomDialogController; + onLanguageSelectUpdate() { + AppStorage.setOrCreate('currentLanguageType', this.languageSelect); + } + build() { Column() { - Text($r('app.string.language_switch'))// [StartExclude text_style1] + Text($r('app.string.language_switch')) .fontSize($r('app.float.size_20')) .fontWeight(FontWeight.Bold) .width('90%') .fontColor(Color.Black) .textAlign(TextAlign.Center) .margin({ top: $r('app.float.size_20'), bottom: $r('app.float.size_12') }) - // [EndExclude text_style1] + // [Start video_language_dialog] List() { ForEach(this.languageList, (item: Resource, index) => { ListItem() { Column() { Row() { - Text(item)// [StartExclude text_style2] + Text(item) + // DocsDot + // [StartExclude text_style2] .fontSize($r('app.float.size_16')) .fontColor(Color.Black) .fontWeight(FontWeight.Medium) .textAlign(TextAlign.Center) // [EndExclude text_style2] + // DocsDot Blank() Image(this.languageSelect === index ? $r('app.media.ic_radio_selected') : - $r('app.media.ic_radio'))// [StartExclude text_style3] + $r('app.media.ic_radio')) + // DocsDot + // [StartExclude text_style3] .width($r('app.float.size_24')) .height($r('app.float.size_24')) .objectFit(ImageFit.Contain) // [EndExclude text_style3] + // DocsDot } + // DocsDot // [StartExclude text_style4] .width('100%') @@ -72,6 +82,7 @@ export struct LanguageDialog { .width('100%') } // [EndExclude text_style4] + // DocsDot } .width('90%') } @@ -79,13 +90,13 @@ export struct LanguageDialog { .height($r('app.float.size_48')) .onClick(() => { this.languageSelect = index; - AppStorage.setOrCreate('currentLanguageType', this.languageSelect); this.avPlayerController.languageChange(this.languageSelect); this.controller.close(); }) }, (item: Resource, index) => index + '_' + JSON.stringify(item)) } - // [StartExclude cancel] + + // [End video_language_dialog] .width('100%') .height('192vp') .margin({ @@ -108,17 +119,12 @@ export struct LanguageDialog { .padding({ bottom: $r('app.float.size_5') }) .width('100%') - // [EndExclude cancel] } - // [StartExclude box_style] .alignItems(HorizontalAlign.Center) .width('100%') .margin({ left: $r('app.float.size_16'), right: $r('app.float.size_16') }) .borderRadius($r('app.float.size_24')) .backgroundColor(Color.White) - // [EndExclude box_style] } -} - -// [End video_language_dialog] \ No newline at end of file +} \ No newline at end of file diff --git a/entry/src/main/ets/views/SpeedDialog.ets b/entry/src/main/ets/views/SpeedDialog.ets index a7ba007..a97c3d5 100644 --- a/entry/src/main/ets/views/SpeedDialog.ets +++ b/entry/src/main/ets/views/SpeedDialog.ets @@ -54,20 +54,27 @@ export struct SpeedDialog { ListItem() { Column() { Row() { - Text(item)// [StartExclude text_style2] + Text(item) + // DocsDot + // [StartExclude text_style2] .fontSize($r('app.float.size_16')) .fontColor(Color.Black) .fontWeight(FontWeight.Medium) .textAlign(TextAlign.Center) // [EndExclude text_style2] + // DocsDot Blank() Image(this.speedSelect === index ? $r('app.media.ic_radio_selected') : - $r('app.media.ic_radio'))// [StartExclude text_style3] + $r('app.media.ic_radio')) + // DocsDot + // [StartExclude text_style3] .width($r('app.float.size_24')) .height($r('app.float.size_24')) .objectFit(ImageFit.Contain) // [EndExclude text_style3] + // DocsDot } + // DocsDot // [StartExclude text_style4] .width('100%') @@ -80,6 +87,7 @@ export struct SpeedDialog { .width('100%') } // [EndExclude text_style4] + // DocsDot } .width('90%') } -- Gitee