PAG官网 | PAG动效

PAG官网 | PAG动效

  • 首页
  • 产品
  • 功能
  • 文档
  • 案例
  • CN
  • GitHub
  • 论坛交流
  • 免费下载
  • Languages iconCN
    • EN

›移动端进阶

了解 PAG

  • Introduction
  • FAQs

快速开始

  • Install PAGViewer
  • Install PAGExporter
  • Export PAG Files
  • SDK Integration

导出插件

  • Use Configuration Panel
  • Use Exporting Panel
  • Export BMP Compositions
  • Config Fill Modes
  • Config Time Stretch Modes
  • Exporting Shortcut Keys
  • Error Code
  • Auto Detection Rules
  • Text Editing Rules
  • Add Text Background
  • Export Audio
  • Manually Install PAGExporter

预览工具

  • Preview Replacements
  • View File Structure
  • Preview Shortcut Keys
  • Export Image Sequence
  • File Encryption
  • Add Watermark
  • Upgrade to Beta Version

性能优化

  • Use Performance Panel
  • PAG File Optimization

移动端进阶

  • Common API Overview
  • Use PAGImageView
  • Video Replacement
  • Play Audio
  • Text Layer Description
  • Use Encripted File
  • Export To Video
  • SDK Authentication

Web 进阶

  • SDK Installation
  • Load PAG File
  • Play PAG File
  • Platform Capabilities
  • Use WebWorker

API 参考

  • API Document

视频教程

  • PAG Workflow
  • File Optimization Best Practices
  • Use PAGExporter Panel
  • PAG Online Q&A

资源下载

  • PAGViewer Installer
  • PAG Test Files
  • PAG Demo Projects
  • China LiveVideoStackCon2022
  • PAG Conversion Tool
  • PAG File Format Spec

TAVMedia

  • Introduction to TAVMedia
  • TAVMedia Quick access
  • Common API Overview

其他

  • From Lottie To PAG
  • PAG Dictionary

Use Encripted File


PAG 企业版 SDK 侧使用加密素材需要通过解密证书。

PAGLicenseManager 只允许通过路径或者文件数据添加证书,加密证书建议通过后台进行下发,防止由于本地证书过期导致素材加载失败。 解密证书可以在调用 PAG SDK 时加载,如果应用没有退出,后续加载加密文件无需再次添加。

Android

/**
 * 使用加密素材时需要添加素材证书,否则文件会加载失败,返回 nil,建议在 APP 启动后直接添加,防止加密素材无法使用
 */
private void initFileLicense() {
    int result = PAGLicenseManager.AddFileLicense(applicationContext, SDK_LICENSE_FILE_PATH);
    if (result == PAGLicenseManager.LicenseResultSuccess) {
        Log.i(TAG, "PAGLicenseManager.AddFileLicense success");
    } else {
        Log.i(TAG, "PAGLicenseManager.AddFileLicense failed");
    }
}

/**
 * 加密文件与普通文件加载一样,不需要使用其他接口。如果文件加载失败,可能是素材的解密证书不存在,或者文件结构出错,可以通过
 * 桌面端 PAGViewer 查看文件状态。
 */
private void loadEncryptedFile() {
    PAGFile pagFile = PAGFile.Load(PAG_FILE_PATH);
    if (pagFile == null) {
        Log.i(TAG, "PAGFile.Load failed");
    } else {
        Log.i(TAG, "PAGFile.Load success");
    }
}

iOS

 /**
  * 使用加密素材时需要添加素材证书,否则文件会加载失败,返回 nil,建议在 APP 启动后直接添加,防止加密素材无法使用
  */
- (void)initFileLicense {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"demo" ofType:@"license"];
    PAGLicenseResult result = [PAGLicenseManager AddFileLicense:path];
    if (result == PAGLicenseResultSuccess) {
        NSLog(@"Successfully added license.");
    } else {
        NSLog(@"Failed to add certificate. Path:%@", path);
    }
}


/**
 * 加密文件与普通文件加载一样,不需要使用其他接口。如果文件加载失败,可能是素材的解密证书不存在,或者文件结构出错,可以通过
 * 桌面端 PAGViewer 查看文件状态。
 */
- (void)loadEncryptedFile {
    NSString *path = [[NSBundle mainBundle] pathForResource:@"encryptedFile" ofType:@"pag"];
    PAGFile *file = [PAGFile Load:path];
}
← Text Layer DescriptionExport To Video →
Address: Tencent Binhai Building, No. 33 Haitian Second Road, Nanshan District, Shenzhen, Guangdong Province, China.
TEL: 0755-86013388
QQ Group: 893379574
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
Privacy Policy
公司地址:广东省深圳市南山区海天二路33号腾讯滨海大厦
联系电话:0755-86013388
QQ群:893379574
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
隐私政策
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
Address: Tencent Binhai Building, No. 33 Haitian Second Road, Nanshan District, Shenzhen, Guangdong Province, China.
TEL: 0755-86013388
QQ Group: 893379574
Privacy Policy
Copyright © 2018 - 2025 Tencent. All Rights Reserved.
公司地址:广东省深圳市南山区海天二路33号腾讯滨海大厦
联系电话:0755-86013388
QQ群:893379574
隐私政策