扫一扫咨询方案
首页
登录/注册

{user.username}

ID: {user.id}

模板 SDK 文档

  • 云渲染

    • Demo下载
    • SDK
    • 开发指南
    • AI API 文档
    • 开发者 API 文档
    • 控制台指南
    • 快速入门
    • 产品简介
  • 模板SDK

    • 用户常见问题
    • Demo 下载
    • 开发指南
    • 服务端 SDK
    • 鸿蒙 SDK
    • iOS SDK
    • 安卓端 SDK
    • 产品简介
  • 剪辑SDK

    • Demo下载
    • SDK
    • 开发指南
    • 产品简介
  • 模板制作教程

    • 模板制作进阶教程
    • 测试模板素材案例下载
    • 常见模板制作案例
    • 模板制作教程
    • 模板制作工具下载
    • 入门指南
  • 剪辑制作教程

    • 剪辑特效导出教程
    • 剪辑特效测试素材
    • 剪辑特效制作工具下载
    • 入门指南
产品简介
安卓端 SDK
iOS SDK
鸿蒙 SDK
服务端 SDK
开发指南
Demo 下载
用户常见问题
首页 > SDK集成

SDK集成

更新时间 : 2026-03-23 16:45:30

SDK集成

初始化

在使用编辑功能前,中先注册License

SXVideo.initLicense("your license");

使用预览组件建议使用XComponent

xcomponentController: XComponentController = new XComponentController()
XComponent({
  id: 'xcomponentId',
  type: 'surface',
  controller: this.xcomponentController
})
.onLoad((xComponentContext) => {
  SXVideo.initLicense(this.license);
  copyRawFile(getContext(this) as common.UIAbilityContext)
})
.onDestroy(() => {
  console.log('onDestroy');
})
.id("xcomponent")

//创建SXEditManager
let options: SXEditOptions = new SXEditOptions(this.xcomponentController.getXComponentSurfaceRect().surfaceWidth, this.xcomponentController.getXComponentSurfaceRect().surfaceHeight, 25);
if (options != null) {
  options.setFontFile("/system/fonts/NotoSansCJK-Regular.ttc");
  this.manager = SXEditManager.create(options);
  //将manager与输出surface绑定
  this.manager.attachToXComponent(this.xcomponentController.getXComponentSurfaceId());
}
首页 > SDK集成
SDK集成
更新时间 : 2026-03-23 16:45:30
  • 云渲染
    • Demo下载
    • SDK
    • 开发指南
    • AI API 文档
    • 开发者 API 文档
    • 控制台指南
    • 快速入门
    • 产品简介
  • 模板SDK
    • 用户常见问题
    • Demo 下载
    • 开发指南
    • 服务端 SDK
    • 鸿蒙 SDK
    • iOS SDK
    • 安卓端 SDK
    • 产品简介
  • 剪辑SDK
    • Demo下载
    • SDK
    • 开发指南
    • 产品简介
  • 模板制作教程
    • 模板制作进阶教程
    • 测试模板素材案例下载
    • 常见模板制作案例
    • 模板制作教程
    • 模板制作工具下载
    • 入门指南
  • 剪辑制作教程
    • 剪辑特效导出教程
    • 剪辑特效测试素材
    • 剪辑特效制作工具下载
    • 入门指南

SDK集成

  • 系统版本
    支持 OpenHarmony SDK Ohos_sdk_public 5.0.0及以上
  • 开发环境
    建议使用DevEco Studio NEXT Developer Build Version: 5.0以上版本
  • SDK文件
    SDK文件为 vesdk.har
  • 集成方式
    把所需SDK文件放入项目libs文件夹中,在项目根目录oh-package.json中添加
    "dependencies": {
        "vesdk": "file:./libs/vesdk.har"
    }
    

初始化

在使用编辑功能前,中先注册License

SXVideo.initLicense("your license");

使用预览组件建议使用XComponent

xcomponentController: XComponentController = new XComponentController()
XComponent({
  id: 'xcomponentId',
  type: 'surface',
  controller: this.xcomponentController
})
.onLoad((xComponentContext) => {
  SXVideo.initLicense(this.license);
  copyRawFile(getContext(this) as common.UIAbilityContext)
})
.onDestroy(() => {
  console.log('onDestroy');
})
.id("xcomponent")

//创建SXEditManager
let options: SXEditOptions = new SXEditOptions(this.xcomponentController.getXComponentSurfaceRect().surfaceWidth, this.xcomponentController.getXComponentSurfaceRect().surfaceHeight, 25);
if (options != null) {
  options.setFontFile("/system/fonts/NotoSansCJK-Regular.ttc");
  this.manager = SXEditManager.create(options);
  //将manager与输出surface绑定
  this.manager.attachToXComponent(this.xcomponentController.getXComponentSurfaceId());
}