From 867d15c8a65f3c544b5f8f59b3066b80f278f188 Mon Sep 17 00:00:00 2001 From: youngshady Date: Thu, 6 Apr 2023 22:11:54 +0800 Subject: [PATCH] modify Player Signed-off-by: youngshady --- .../src/main/ets/pages/Player/PlayAudioList.ets | 9 +-------- .../src/main/ets/pages/Player/PlayVideo.ets | 2 +- .../src/main/ets/pages/Player/PlayVideoList.ets | 11 ++--------- 3 files changed, 4 insertions(+), 18 deletions(-) diff --git a/validator/acts_validator/src/main/ets/pages/Player/PlayAudioList.ets b/validator/acts_validator/src/main/ets/pages/Player/PlayAudioList.ets index 9b67b7477..8aec046bf 100644 --- a/validator/acts_validator/src/main/ets/pages/Player/PlayAudioList.ets +++ b/validator/acts_validator/src/main/ets/pages/Player/PlayAudioList.ets @@ -43,14 +43,6 @@ struct audioNew { @State TestCaseList: Array = []; @State ColorObject: string[] = VarColor; - async aboutToAppear() { - this.getAudioData(); - } - - async getAudioData() { - this.TestCaseList = await this.MediaLib.getFileAssetsAlbum('Audios/ValidatorData/'); - } - async onPageShow() { let Test = null; let context = null; @@ -66,6 +58,7 @@ struct audioNew { Test = data; console.info("Succeeded in getting value of 'PlayerAudio'. Data: " + data); }); + this.TestCaseList = await this.MediaLib.getFileAssetsAlbum('Audios/ValidatorData/'); if (Test != 1) { let fd = fileio.openSync(ColorBackPath, 0o102, 0o666); diff --git a/validator/acts_validator/src/main/ets/pages/Player/PlayVideo.ets b/validator/acts_validator/src/main/ets/pages/Player/PlayVideo.ets index 5dfae64fc..32634bc4a 100644 --- a/validator/acts_validator/src/main/ets/pages/Player/PlayVideo.ets +++ b/validator/acts_validator/src/main/ets/pages/Player/PlayVideo.ets @@ -26,7 +26,7 @@ struct playVideo { @State StepTips: string = '测试目的:用于测试视频播放暂停seek\n预期结果:视频播放暂停seek功能正常'; private tag: string = 'qlw'; @State Vue: boolean = false; - @State videoSrc: Resource = $rawfile('H264_AAC.mkv'); + @State videoSrc: string = router.getParams()['audioUrl']; @State isAutoPlay: boolean = true; @State showControls: boolean = true; controller: VideoController = new VideoController(); diff --git a/validator/acts_validator/src/main/ets/pages/Player/PlayVideoList.ets b/validator/acts_validator/src/main/ets/pages/Player/PlayVideoList.ets index b7fa39cfb..c319061e2 100644 --- a/validator/acts_validator/src/main/ets/pages/Player/PlayVideoList.ets +++ b/validator/acts_validator/src/main/ets/pages/Player/PlayVideoList.ets @@ -43,14 +43,6 @@ struct videoNew { @State TestCaseList: Array = []; @State ColorObject: string[] = VarColor; - async aboutToAppear() { - this.getVideoData(); - } - - async getVideoData() { - this.TestCaseList = await this.MediaLib.getFileAssetsAlbum('Videos/ValidatorData/'); - } - async onPageShow() { let Test = null; let context = null; @@ -66,6 +58,7 @@ struct videoNew { Test = data; console.info("Succeeded in getting value of 'PlayerVideo'. Data: " + data); }); + this.TestCaseList = await this.MediaLib.getFileAssetsAlbum('Videos/ValidatorData/'); if (Test != 1) { let fd = fileio.openSync(ColorBackPath, 0o102, 0o666); @@ -116,7 +109,7 @@ struct videoNew { fileio.closeSync(FD); let Fd = fileio.openSync(ColorBackPath, 0o102, 0o666); fileio.writeSync(Fd, Report); - filewrite(name1, results, titles) + filewrite(name1, results, titles); } else if (this.result === 'false') { this.ColorObject[this.current] = '#ffff0000'; -- GitLab