From 5efb9cd735f7547382fdf449d4363ea652e4c000 Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Mon, 9 Jun 2025 16:21:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=A7=86=E9=A2=91=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/VideoConfig.ets | 5 +++-- entry/src/main/ets/utils/Video.ets | 10 +++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/entry/src/main/ets/pages/VideoConfig.ets b/entry/src/main/ets/pages/VideoConfig.ets index 001b1e2..5eeab82 100644 --- a/entry/src/main/ets/pages/VideoConfig.ets +++ b/entry/src/main/ets/pages/VideoConfig.ets @@ -42,7 +42,7 @@ struct VideoConfigPage { rocord_handle4: 0 } // 文件操作 - private fileUtil: FileUtils + private fileUtil!: FileUtils private context = getContext(this) as common.UIAbilityContext; // 视频控制器 private controller1: VideoController = new VideoController() @@ -94,7 +94,8 @@ struct VideoConfigPage { direction: FlexDirection.Column }) { HeaderComponent({ - shortLogo: false + shortLogo: true, + shouBackArea: true }) Flex() { // 左边视频监控区域 diff --git a/entry/src/main/ets/utils/Video.ets b/entry/src/main/ets/utils/Video.ets index 0fde8c6..7cfaeed 100644 --- a/entry/src/main/ets/utils/Video.ets +++ b/entry/src/main/ets/utils/Video.ets @@ -34,8 +34,8 @@ const FILE_ASSET_FETCH_COLUMNS = [ export async function startRecordVideo(param: VideoConfig, td: number, context: common.UIAbilityContext, dir: string, - path?: string, - index?: number): Promise { + path?: string, + index?: number): Promise { return new Promise(async (resolve, reject) => { let video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${td}/main/av_stream`; if (rtsp_server != null) { @@ -168,7 +168,7 @@ export async function takePhoto( if (flag === 0) { return new Promise((resolve, reject) => { - rtsp_server.detectVideoSnapshotSize(video_uri, fileName, false,(err: BusinessError, snapResult: record.RtspResult) => { + rtsp_server.detectVideoSnapshotSize(video_uri, fileName, false, (err: BusinessError, snapResult: record.RtspResult) => { if (snapResult && snapResult.errorCode === 0) { const result: takePhotoParam = { fileSize: snapResult.fileSize, @@ -197,7 +197,7 @@ export async function takePhoto( const time = GetCurrentTime(); const date = time.split(' ')[0]; const dirName = dir || date; - rtsp_server.detectVideoSnapshotSize(video_uri, fileName, true,(err: BusinessError, snapResult: record.RtspResult) => { + rtsp_server.getVideoSnapshot(context, video_uri, fileName, dirName, true, (err: BusinessError, snapResult: record.RtspResult) => { if (snapResult && snapResult.errorCode === 0) { const result: takePhotoParam = { fileSize: snapResult.fileSize, @@ -234,7 +234,7 @@ export async function deleteAllFileByPiC(dirName: string, type = 1, context: com } export async function deleteAllVideos(context: common.UIAbilityContext, type: photoAccessHelper.AlbumType, - subType: photoAccessHelper.AlbumSubtype): Promise { + subType: photoAccessHelper.AlbumSubtype): Promise { let fetchResult: photoAccessHelper.FetchResult | null = null; let count = 0; try {