做企业网站接单怎么做原创短视频网站

张小明 2026/1/9 13:48:45
做企业网站接单,怎么做原创短视频网站,机关公文写作网站,微信开发网站开发一.背景目前需要实现活体检测功能#xff0c;而且是需要静默活体#xff0c;但是现在官方的活体API还不支持静默#xff0c;第三方的SDK也不支持#xff0c;现在自定义一个类似活体检测的功能#xff0c;但是不会去检测是否活体#xff0c;拿到照片以后去调用人脸识别二.…一.背景目前需要实现活体检测功能而且是需要静默活体但是现在官方的活体API还不支持静默第三方的SDK也不支持现在自定义一个类似活体检测的功能但是不会去检测是否活体拿到照片以后去调用人脸识别二.实现思路先调用相机将相机设置为前置摄像头将当前相机内容使用XComponent实时渲染启用定时拍照功能设置定时器时间到以后利用截图组件功能去做然后拿到图片地址去进行人脸识别不保存到本地三.代码这边只放了首页代码其余代码会在包里在文章后附带使用的时候将包放到项目中直接跳转或者引用xsComponent这个页面/* * Copyright (c) 2025 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the License); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an AS IS BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ import { CameraConstants } from ./constants/CameraConstants; import { CameraUtils } from ./utils/CameraUtils; import { abilityAccessCtrl, bundleManager, common, PermissionRequestResult, Permissions } from kit.AbilityKit; import { BusinessError, emitter } from kit.BasicServicesKit; import Logger from ./utils/Logger; import { TwiceReqPermissionButtonComponent } from ./component/TwiceReqPermissionButtonComponent; import { StackXComponent } from ./component/StackXComponent; import LoadingDialog from lyb/loading-dialog; import { DynamicsRouter } from common; Builder export function xsIndexBuilder() { xsIndex() } Entry Component struct xsIndex { Provide cameraPosition: number 1; // 固定为前置摄像头 Provide notHasPermission: boolean true; Provide surfaceId: string ; Provide timerShooting: number 3; // 固定3秒 Provide captureTimer: number 0; Provide isVisibleTimerSet: boolean false; Provide isVisibleTimer: boolean false; Provide isVisibleCapture: boolean true; Provide captureClickFlag: number 0; State autoCaptureStarted: boolean false; // 标记是否已开始自动拍照 private uiContext: UIContext this.getUIContext(); private cameraUtils new CameraUtils(this.uiContext); checkPermissions(permission: Permissions) { let atManager abilityAccessCtrl.createAtManager(); let bundleInfo bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_WITH_APPLICATION); let tokenID bundleInfo.appInfo.accessTokenId; let authResults atManager.checkAccessTokenSync(tokenID, permission); return authResults abilityAccessCtrl.GrantStatus.PERMISSION_GRANTED; } aboutToDisappear(): void { this.cameraUtils.releaseCamera(); } AppStorage.setOrCreate(cameraUtils, this.cameraUtils); let atManager: abilityAccessCtrl.AtManager abilityAccessCtrl.createAtManager(); let context: Context this.getUIContext().getHostContext() as common.UIAbilityContext; atManager.requestPermissionsFromUser(context, [ohos.permission.CAMERA]) .then((data: PermissionRequestResult) { if (data.authResults[0] 0) { this.notHasPermission false; this.cameraUtils.cameraShooting(this.cameraPosition, this.surfaceId, context); // 延迟启动自动拍照等待相机初始化完成 setTimeout(() { this.startAutoCapture(); }, 500); } else if (data.authResults[0] -1) { this.notHasPermission true; } }) .catch((err: BusinessError) { Logger.error(data: ${JSON.stringify(err)}); }); } // 开始自动拍照流程 startAutoCapture(): void { if (this.autoCaptureStarted || this.notHasPermission) { return; } this.autoCaptureStarted true; this.isVisibleTimer true; this.captureTimer this.timerShooting; this.isVisibleCapture false; // 3秒后自动拍照 setTimeout(() { this.cameraUtils.capture(true); // 前置摄像头需要镜像 this.captureClickFlag this.captureClickFlag 1; this.isVisibleCapture true; this.isVisibleTimer false; }, this.captureTimer * 1000); } onPageShow() { if (!this.notHasPermission) { let permissions: Permissions ohos.permission.CAMERA; if (this.checkPermissions(permissions)) { this.cameraUtils.cameraShooting(this.cameraPosition, this.surfaceId, this.getUIContext().getHostContext()!); this.notHasPermission false; // 如果还没有开始自动拍照则启动 if (!this.autoCaptureStarted) { setTimeout(() { this.startAutoCapture(); }, 500); } } else { this.notHasPermission true; } } } onPageHide(): void { if (!this.notHasPermission) { this.cameraUtils.releaseCamera(); } } build() { NavDestination() { Column() { if (this.notHasPermission) { TwiceReqPermissionButtonComponent(); } else { Row() { Image($r(app.media.back)) .width(25) .height(25) .onClick(() { DynamicsRouter.pop() }) }.width(100%).padding(15) StackXComponent(); } } .height(CameraConstants.FULL_SCREEN) .width(CameraConstants.FULL_SCREEN) .backgroundColor(Color.White) // 白色背景 .padding({ top: this.uiContext.px2vp(AppStorage.get(topAvoid)) as number, bottom: this.uiContext.px2vp(AppStorage.get(bottomAvoid)) as number }); }.hideBackButton(true) } }
版权声明:本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

网站首页静态好还是动态好品牌专业群建设网站

在不确定性中寻找确定性‌ 在快速迭代的敏捷与DevOps环境中,软件测试的角色已从单纯的质量“守门员”,演变为贯穿产品生命周期的“质量赋能者”。对于测试从业者而言,掌握扎实的理论基础固然重要,但能将理论灵活转化为解决复杂、多…

张小明 2026/1/7 20:31:35 网站建设

建设银行网站会员登陆网站搜索引擎优化公司

格罗弗搜索算法:量子搜索的强大工具 在当今的计算领域,搜索算法是一项基础且关键的技术。传统的搜索算法在处理大规模数据时往往效率低下,而量子搜索算法的出现为解决这一问题提供了新的思路。格罗弗搜索算法就是其中一种非常有潜力的量子搜索算法,它在处理大规模数据时展…

张小明 2026/1/7 20:17:23 网站建设

阿里云的网站建设花钱么谷歌排名推广

第一章:紧急告警频发?用Open-AutoGLM三步锁定问题源头,90%团队不知道在微服务架构日益复杂的今天,运维团队常被高频告警淹没,难以快速识别真实故障根源。Open-AutoGLM 作为一款开源的智能日志归因分析工具,…

张小明 2026/1/7 20:32:22 网站建设

公司网站如何做分录私有云可以做网站

Pyarmor-Static-Unpack-1shot是一款专业的Python代码解密工具,专门用于静态反编译Pyarmor加密的脚本文件。该工具无需执行加密代码即可完成完整的解密过程,支持从Pyarmor 8.0到最新9.1.2版本,兼容Python 3.7至3.13的广泛版本范围,…

张小明 2026/1/7 20:17:27 网站建设

云建站规划图成都房地产网站建设

图表生成工具革新:用文本即图表理念提升可视化效率300% 【免费下载链接】drawio_mermaid_plugin Mermaid plugin for drawio desktop 项目地址: https://gitcode.com/gh_mirrors/dr/drawio_mermaid_plugin 在当今信息密集的工作环境中,图表生成工…

张小明 2026/1/7 20:17:26 网站建设

换网站了吗网站信息建设总结

数据集格式:Pascal VOC格式YOLO格式(不包含分割路径的txt文件,仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件)图片数量(jpg文件个数):9400标注数量(xml文件个数):9400标注数量(txt文件个数):9400标注类别…

张小明 2026/1/7 20:17:29 网站建设