diff --git a/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets b/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets index 96e4cd1d739c4bd5036e569d9fd56ccf11ef1b6e..46e3966646f176dec32123da7bf9496f3ac42fee 100644 --- a/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets +++ b/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingTypeC.ets @@ -104,7 +104,7 @@ struct audioInputRouting { } Row(){ Column(){ - Button(`No`) + Button(`不支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -115,7 +115,7 @@ struct audioInputRouting { }) } Column(){ - Button(`Yes`) + Button(`支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -126,14 +126,14 @@ struct audioInputRouting { } } Row(){ - Text('测试目的:\n当设备连接TypeC耳机时,是否音频输入路由正确切换\n测试准备\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持TypeC耳机\n2. 按下RECORD按钮\n3. 连接TypeC耳机\n4. 对着耳机mic讲话\n5. 按下STOP按钮\n6. 按下PLAY按钮听录制音频正常播放\n测试标准:\n如果设备不支持TypeC耳机输入或者接收到输入路由通知、路由显示为TypeC耳机,通过TypeC可正常录制和播放,则用例pass').fontColor(Color.White).fontSize('18fp') + Text('测试目的:\n当设备连接TypeC耳机时,是否音频输入路由正确切换\n测试准备\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持TypeC耳机\n2. 连接TypeC耳机\n3. 按下录制按钮\n4. 对着耳机mic讲话\n5. 按下停止按钮\n6. 按下播放按钮\n测试标准:\n如果设备不支持TypeC耳机输入或者接收到输入路由通知、路由显示为TypeC耳机,通过TypeC可正常录制和播放,则用例pass').fontColor(Color.White).fontSize('18fp') } Row(){ Text(`Audio输入路由:${this.inputDevice}`).fontColor(Color.White).fontSize('18fp') } Row(){ Column(){ - Button(`RECORD`) + Button(`录制`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -147,7 +147,7 @@ struct audioInputRouting { }) } Column(){ - Button(`STOP`) + Button(`停止`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -162,7 +162,7 @@ struct audioInputRouting { }) } Column(){ - Button(`PLAY`) + Button(`播放`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') diff --git a/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets b/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets index 6bba9beee46cbc323fdbd41bb27d8e82f8022a1d..cab2c341191b7aa97167f74b492aeb1526e5044a 100644 --- a/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets +++ b/validator/acts_validator/src/main/ets/pages/Audio/AudioInputRoutingWiredHeadset.ets @@ -104,7 +104,7 @@ struct audioInputRouting { } Row(){ Column(){ - Button(`No`) + Button(`不支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -115,7 +115,7 @@ struct audioInputRouting { }) } Column(){ - Button(`Yes`) + Button(`支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -126,14 +126,14 @@ struct audioInputRouting { } } Row(){ - Text('测试目的:\n当设备连接3.5mm有线耳机时,是否音频输入路由正确切换\n测试准备\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持3.5mm有线耳机\n2. 按下RECORD按钮\n3. 连接3.5mm有线耳机\n4. 对着耳机mic讲话\n5. 按下STOP按钮\n6. 按下PLAY按钮听录制音频正常播放\n测试标准:\n如果设备不支持3.5mm有线耳机输入或者接收到路由通知、路由显示为3.5mm耳机,通过3.5mm耳机可正常录制和播放,则用例pass').fontColor(Color.White).fontSize('18fp') + Text('测试目的:\n当设备连接3.5mm有线耳机时,是否音频输入路由正确切换\n测试准备\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持3.5mm有线耳机\n2. 连接3.5mm有线耳机\n3. 按下录制按钮\n4. 对着耳机mic讲话\n5. 按下停止按钮\n6. 按下播放按钮\n测试标准:\n如果设备不支持3.5mm有线耳机输入或者接收到路由通知、路由显示为3.5mm耳机,通过3.5mm耳机可正常录制和播放,则用例pass').fontColor(Color.White).fontSize('18fp') } Row(){ Text(`Audio输入路由:${this.inputDevice}`).fontColor(Color.White).fontSize('18fp') } Row(){ Column(){ - Button(`RECORD`) + Button(`录制`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -147,7 +147,7 @@ struct audioInputRouting { }) } Column(){ - Button(`STOP`) + Button(`停止`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -162,7 +162,7 @@ struct audioInputRouting { }) } Column(){ - Button(`PLAY`) + Button(`播放`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') diff --git a/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets b/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets index db8bfd0f36d152cd99b42eb2bf643dcee1ddd942..91ad2cad4221fce114eed13f6252be951ede0389 100644 --- a/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets +++ b/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingBT.ets @@ -94,7 +94,7 @@ struct audioOutputRouting { } Row(){ Column(){ - Button(`No`) + Button(`不支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -105,7 +105,7 @@ struct audioOutputRouting { }) } Column(){ - Button(`Yes`) + Button(`支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -117,7 +117,7 @@ struct audioOutputRouting { } } Row(){ - Text('测试目的:\n当设备连接蓝牙耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持蓝牙外设\n2. 按下PLAY按钮\n3. 连接蓝牙耳机\n4. 拔出蓝牙耳机\n5. 按下STOP按钮\n测试标准:\n如果设备不支持蓝牙耳机连接或者插拔蓝牙耳机后接收到路由通知、路由显示正确,且连接蓝牙后音频通过蓝牙耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp') + Text('测试目的:\n当设备连接蓝牙耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持蓝牙外设\n2. 按下播放按钮\n3. 连接华为蓝牙耳机\n4. 拔出蓝牙耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持蓝牙耳机连接或者插拔蓝牙耳机后接收到路由通知、路由显示正确,且连接蓝牙后音频通过蓝牙耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp') } Row(){ @@ -125,7 +125,7 @@ struct audioOutputRouting { } Row(){ Column(){ - Button(`PLAY`) + Button(`播放`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -141,7 +141,7 @@ struct audioOutputRouting { }) } Column(){ - Button(`STOP`) + Button(`停止`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') diff --git a/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets b/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets index 4c6454ff3460108452778f5bdd92a7b35ac53365..87bac194e1d2ae92df34ca774d4876cdb6d2ccfb 100644 --- a/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets +++ b/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingTypeC.ets @@ -94,7 +94,7 @@ struct audioOutputRouting { } Row(){ Column(){ - Button(`No`) + Button(`不支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -105,7 +105,7 @@ struct audioOutputRouting { }) } Column(){ - Button(`Yes`) + Button(`支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -117,7 +117,7 @@ struct audioOutputRouting { } } Row(){ - Text('测试目的:\n当设备连接TypeC耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持TypeC外设\n2. 按下PLAY按钮\n3. 连接TypeC耳机\n4. 拔出TypeC耳机\n5. 按下STOP按钮\n测试标准:\n如果设备不支持TypeC耳机连接或者插拔TypeC耳机后接收到路由通知、路由显示正确,且连接TypeC后音频通过TypeC耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp') + Text('测试目的:\n当设备连接TypeC耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持TypeC外设\n2. 按下播放按钮\n3. 连接华为TypeC耳机\n4. 拔出TypeC耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持TypeC耳机连接或者插拔TypeC耳机后接收到路由通知、路由显示正确,且连接TypeC后音频通过TypeC耳机播放,则用例pass').fontColor(Color.White).fontSize('18fp') } Row(){ @@ -125,7 +125,7 @@ struct audioOutputRouting { } Row(){ Column(){ - Button(`PLAY`) + Button(`播放`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -141,7 +141,7 @@ struct audioOutputRouting { }) } Column(){ - Button(`STOP`) + Button(`停止`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') diff --git a/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets b/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets index 91a72f83a6af5f23f6e6178bddeee3d343f1d33f..c6aada4e1b7431ff9a95568e8ccd7326ab37b08b 100644 --- a/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets +++ b/validator/acts_validator/src/main/ets/pages/Audio/AudioOutputRoutingWiredHeadset.ets @@ -94,7 +94,7 @@ struct audioOutputRouting { } Row(){ Column(){ - Button(`No`) + Button(`不支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -105,7 +105,7 @@ struct audioOutputRouting { }) } Column(){ - Button(`Yes`) + Button(`支持`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -117,7 +117,7 @@ struct audioOutputRouting { } } Row(){ - Text('测试目的:\n当设备连接3.5mm有线耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持外设\n2. 按下PLAY按钮\n3. 连接3.5mm有线耳机\n4. 拔出3.5mm有线耳机\n5. 按下STOP按钮\n测试标准:\n如果设备不支持有线耳机输入或者插入和拔出有线耳机后接收到路由通知,路由显示正确,且连接外设后音频通过外设播放,则用例pass').fontColor(Color.White).fontSize('18fp') + Text('测试目的:\n当设备连接3.5mm有线耳机时,音频路由是否正确切换\n测试准备:\n断连任何外设,保持设备常亮\n测试步骤:\n1. 验证设备是否支持3.5mm耳机外设\n2. 按下播放按钮\n3. 连接华为3.5mm有线耳机\n4. 拔出3.5mm有线耳机\n5. 按下停止按钮\n测试标准:\n如果设备不支持有线耳机输入或者插入和拔出有线耳机后接收到路由通知,路由显示正确,且连接外设后音频通过外设播放,则用例pass').fontColor(Color.White).fontSize('18fp') } Row(){ @@ -125,7 +125,7 @@ struct audioOutputRouting { } Row(){ Column(){ - Button(`PLAY`) + Button(`播放`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') @@ -141,7 +141,7 @@ struct audioOutputRouting { }) } Column(){ - Button(`STOP`) + Button(`停止`) .borderRadius(8) .backgroundColor(0x317aff) .width('30%') diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation.ets index c6dc81f814f8c6c44ae349a98b308fc483e14c9a..f952a36442caf3f9bf0c82740dbd6a2dbb54d8b6 100644 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation.ets +++ b/validator/acts_validator/src/main/ets/pages/Camera/CameraOrientation.ets @@ -26,7 +26,7 @@ import router from '@ohos.router'; struct cameraOrientation { @State FillColor: string = '#FF000000'; @State name: string = 'CameraOrientation'; - @State StepTips: string = '测试目的:用于测试相机预览和拍照旋转能力\n-左侧显示给定旋转角度后的预览窗口\n-右侧显示拍照后的图片\n-对于前置摄像头会有镜像效果' + '\n' + '预期结果:拍照图片与预览窗口的画面一致'; + @State StepTips: string = '测试目的:用于测试相机预览和拍照旋转能力\n-左侧显示预览窗口\n-右侧显示指定旋转角度的拍照图片\n-对于前置摄像头会有镜像效果' + '\n' + '预期结果:拍照图片与预览窗口的画面一致'; private tag: string = 'qlw CameraOrientation' private mXComponentController: XComponentController = new XComponentController() @State surfaceId: number = 0; @@ -130,12 +130,12 @@ struct cameraOrientation { }) }) .size({ width: '100%', height: '100%' }) - Text('Camera Preview').fontSize('20fp').fontColor(Color.White) + Text('预览').fontSize('20fp').fontColor(Color.White) }.size({ width: '40%', height: '60%' }) Column() { Image(this.assetUri || '').size({ width: '100%', height: '100%' }).border({ width: 1 }) - Text('Oriented Photo').fontSize('20fp').fontColor(Color.White) + Text('带旋转角度的图片').fontSize('20fp').fontColor(Color.White) }.size({ width: '40%', height: '60%' }) }.width('100%').height('50%') @@ -144,7 +144,7 @@ struct cameraOrientation { Text(`Orientation: ${this.imageRotation}°`).fontSize('16fp').fontColor(Color.White) Text(`顺时针`).fontSize('16fp').fontColor(Color.White) Text(`提示:`).fontSize('16fp').fontColor(Color.White) - Text(`如果左边窗口旋转后与右边窗口相同,选择pass,否则选择fail`) + Text(`如果左边预览窗口顺时针旋转后与右边窗口相同,选择pass,否则选择fail`) .fontSize('16fp').fontColor(Color.White) }.size({ width: '80%', height: '25%' }) diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets index f1b4bd7bff89c0b2c1653dc47074dcb71d611eb3..4fb4d1064d67f0bc0da5f15df4951869af14b993 100644 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets +++ b/validator/acts_validator/src/main/ets/pages/Camera/CameraPhotoFormat.ets @@ -26,7 +26,7 @@ import router from '@ohos.router'; struct cameraOrientation { @State FillColor: string = '#FF000000'; @State name: string = 'CameraPhotoFormat'; - @State StepTips: string = '测试目的:用于测试相机拍照分辨率能力\n预期结果:所有分辨率均可以拍照,图片与预览一致'; + @State StepTips: string = '测试目的:用于测试相机拍照分辨率能力\n测试步骤:\n1. 点击拍照\n2. 点击下一个\n3. 重复步骤1和2直至所有拍照分辨率均遍历完成\n预期结果:所有分辨率均可以拍照,图片与预览一致'; private tag: string = 'qlw' private mXComponentController: XComponentController = new XComponentController() @State surfaceId: number = 0; @@ -140,12 +140,12 @@ struct cameraOrientation { this.cameraInit() }) .size({ width: '100%', height: '100%' }) - Text('Camera Preview').fontSize('20fp').fontColor(Color.White) + Text('预览').fontSize('20fp').fontColor(Color.White) }.size({ width: '40%', height: '60%' }) Column() { Image(this.assetUri || '').size({ width: '100%', height: '100%' }).border({ width: 1 }) - Text('Oriented Photo').fontSize('20fp').fontColor(Color.White) + Text('图片').fontSize('20fp').fontColor(Color.White) }.size({ width: '40%', height: '60%' }) }.width('100%').height('50%') @@ -191,7 +191,7 @@ struct cameraOrientation { }) }.justifyContent(FlexAlign.SpaceEvenly) - Text(`提示:对不同分辨率的图片进行拍摄,根据拍摄结果选择pass或选择fail`) + Text(`提示:不同拍照分辨率下进行拍摄,图片拍摄成功且与预览画面一致则选择pass,否则选择fail`) .fontSize('16fp').fontColor(Color.White).margin({ top: 20 }) }.size({ width: '80%', height: '20%' }) @@ -206,7 +206,7 @@ struct cameraOrientation { this.isNextEnabled = false CameraService.takePicture() }) - Button('NEXT') + Button('下一个') .enabled(!this.isNextEnabled) .opacity(!this.isNextEnabled ? 1 : 0.4) .width('40%') @@ -222,11 +222,18 @@ struct cameraOrientation { this.isNextEnabled = true return } - this.cameraDeviceIndex = Number(!this.cameraDeviceIndex) this.clickFrequency = 0 - await this.cameraInit().then(() => { - this.isCameraChange = true - }) + if (this.cameraListLength > 1) { + this.cameraDeviceIndex = Number(!this.cameraDeviceIndex) + await this.cameraInit().then(() => { + this.isCameraChange = true + }) + } else { + this.Vue = true + this.isEnabled = false + this.isNextEnabled = true + return + } } this.isEnabled = true this.isNextEnabled = true @@ -256,4 +263,4 @@ struct cameraOrientation { url:'pages/Camera/Camera_index', }) } -} \ No newline at end of file +} diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets index 5a6a365953e67a3b3a61db7f3d3d056eb1c91f4b..915e7d5c9e3e2a4955cd4df714bd18d937a22c0e 100644 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets +++ b/validator/acts_validator/src/main/ets/pages/Camera/CameraPreviewFormat.ets @@ -26,7 +26,7 @@ import router from '@ohos.router'; struct cameraFormat { @State FillColor: string = '#FF000000'; @State name: string = 'CameraPreviewFormat'; - @State StepTips: string = '测试目的:用于测试相机预览分辨率能力\n预期结果:所有分辨率均可以预览成功,预览画面正常'; + @State StepTips: string = '测试目的:用于测试相机预览分辨率能力\n测试步骤:点击下一个遍历所有预览分辨率,观察预览窗口\n预期结果:所有分辨率均可以预览成功,预览画面正常'; private tag: string = 'qlw CameraFormat' private mXComponentController: XComponentController = new XComponentController() @State surfaceId: number = 0; @@ -145,7 +145,7 @@ struct cameraFormat { this.cameraInit() }) .size({ width: '100%', height: '100%' }) - Text('Camera Preview').fontSize('20fp').fontColor(Color.White) + Text('预览').fontSize('20fp').fontColor(Color.White) }.size({ width: '80%', height: '70%' }) Column() { @@ -201,7 +201,7 @@ struct cameraFormat { .onSelect((index: number, value) => { Logger.info(this.tag, `onSelect format index: ${index}, value: ${value}`) }) - Button('NEXT') + Button('下一个') .borderRadius(8) .backgroundColor(0x317aff) .enabled(this.nextEnabled) @@ -229,4 +229,4 @@ struct cameraFormat { url:'pages/Camera/Camera_index', }) } -} \ No newline at end of file +} diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets index e8d5d6b532465887e5113cdefd306be850169e88..2d7336da2ea620e9843f17ac4d52e95b958ef982 100644 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets +++ b/validator/acts_validator/src/main/ets/pages/Camera/CameraSerialPhoto.ets @@ -26,7 +26,7 @@ import router from '@ohos.router'; struct cameraOrientation { @State FillColor: string = '#FF000000'; @State name: string = 'CameraSerialPhoto'; - @State StepTips: string = '测试目的:用于测试相机连拍\n-左侧显示相机预览窗口\n-右侧显示拍照后的每个图片\n-对于前置摄像头会有镜像效果\n测试步骤:\n1.点击拍照按钮\n预期结果:点击拍照按钮后每个摄像头连拍生成10张图片'; + @State StepTips: string = '测试目的:用于测试相机连拍\n-左侧显示相机预览窗口\n-右侧显示拍照后的每个图片\n-对于前置摄像头会有镜像效果\n测试步骤:\n1.点击拍照按钮\n预期结果:点击拍照按钮后每个摄像头连拍生成10张图片,图片显示正常'; private tag: string = 'qlw CameraSerialPhoto' private mXComponentController: XComponentController = new XComponentController() @State surfaceId: number = 0; @@ -133,12 +133,12 @@ struct cameraOrientation { }) }) .size({ width: '100%', height: '100%' }) - Text('Camera Preview').fontSize('20fp').fontColor(Color.White) + Text('预览').fontSize('20fp').fontColor(Color.White) }.size({ width: '40%', height: '60%' }) Column() { Image(this.assetUri || '').size({ width: '100%', height: '100%' }).border({ width: 1 }) - Text('Oriented Photo').fontSize('20fp').fontColor(Color.White) + Text('图片').fontSize('20fp').fontColor(Color.White) }.size({ width: '40%', height: '60%' }) }.width('100%').height('50%') @@ -191,4 +191,4 @@ struct cameraOrientation { url:'pages/Camera/Camera_index', }) } -} \ No newline at end of file +} diff --git a/validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets b/validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets index cb4ee232306dc00b78bdd2e0712fd64ef2d4e5ea..fdb4073da989885bd1b0a85f0eeb6a183ccc8251 100644 --- a/validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets +++ b/validator/acts_validator/src/main/ets/pages/Camera/CameraVideo.ets @@ -45,11 +45,18 @@ struct cameraOrientation { @State testingFrequency: number = undefined // 测试总数 @State testEnabled: boolean = true @State nextEnabled: boolean = false + @State isVideoPlayback: boolean = false async aboutToAppear() { await FirstDialog.ChooseDialog(this.StepTips, this.name); + mediaPlay.setVideoPlaybackCallback(this.handleVideoPlayback.bind(this)) } + handleVideoPlayback = (isVideoPlayback: boolean) => { + this.isVideoPlayback = isVideoPlayback + Logger.info(this.tag, `VideoPlayBack end, isVideoPlayback: ${this.isVideoPlayback}`) + } + cameraListFn() { this.cameraList = [] this.cameraListLength = CameraService.cameras.length @@ -150,19 +157,21 @@ struct cameraOrientation { this.cameraInit() }) .size({ width: '100%', height: '100%' }) - Text('Video capture').fontSize('20fp').fontColor(Color.White) + Text('视频录制').fontSize('20fp').fontColor(Color.White) }.size({ width: '45%', height: '100%' }) Column() { - XComponent({ - id: '', - type: 'surface', - controller: this.mXComponentController1 - }) - .onLoad(() => { - }) - .size({ width: '100%', height: '100%' }) - Text('Video callback').fontSize('20fp').fontColor(Color.White) + if(!this.isVideoPlayback){ + XComponent({ + id: '', + type: 'surface', + controller: this.mXComponentController1 + }) + .onLoad(() => { + }) + .size({ width: '100%', height: '100%' }) + Text('视频回放').fontSize('20fp').fontColor(Color.White) + } }.size({ width: '45%', height: '100%' }) }.size({ width: '100%', height: '50%' }) @@ -223,7 +232,7 @@ struct cameraOrientation { }.size({ width: '100%', height: '50%' }) Row() { - Button('TEST') + Button('录制') .borderRadius(8) .backgroundColor(0x317aff) .margin(15) @@ -245,7 +254,7 @@ struct cameraOrientation { }, 4000) }) }) - Button('NEXT') + Button('下一个') .borderRadius(8) .backgroundColor(0x317aff) .margin(15) @@ -274,4 +283,4 @@ struct cameraOrientation { url:'pages/Camera/Camera_index', }) } -} \ No newline at end of file +} diff --git a/validator/acts_validator/src/main/ets/pages/model/mediaPlay.ts b/validator/acts_validator/src/main/ets/pages/model/mediaPlay.ts index 1cd845e064418958615068c05a8e73c7b2f55287..33b337ec899896e2685f4df4b98b80029bb01dd3 100644 --- a/validator/acts_validator/src/main/ets/pages/model/mediaPlay.ts +++ b/validator/acts_validator/src/main/ets/pages/model/mediaPlay.ts @@ -9,6 +9,7 @@ export class mediaPlay { private avPlay: media.AVPlayer = undefined private surfaceId: number = -1 public totalDuration: number + private handleVideoPlayback: (isVideoPlayback: boolean) => void = false async getFileFd(name) { let filesDir = globalThis.abilityContext.filesDir @@ -65,8 +66,8 @@ export class mediaPlay { break; case 'initialized': Logger.info(TAG + 'state initialized start ') - if (this.surfaceId) { - AVPlayer.surfaceId = this.surfaceId + if (this.surfaceId != -1) { + AVPlayer.surfaceId = String(this.surfaceId) } await AVPlayer.prepare() Logger.info(TAG, 'state initialized end') @@ -85,6 +86,9 @@ export class mediaPlay { case 'completed': await AVPlayer.stop() await AVPlayer.release() + if (this.handleVideoPlayback) { + this.handleVideoPlayback(true) + } case 'error': Logger.info(TAG, 'state error callback') break; @@ -94,6 +98,10 @@ export class mediaPlay { Logger.info(TAG, `state error callback err:${err},code:${err.code},message:${err.message}}`) }) } + + setVideoPlaybackCallback(callback) { + this.handleVideoPlayback = callback + } async release(){ if (this.avPlay){