tencent cloud

Tencent Cloud Super App as a Service

Release Notes and Announcements
Announcement: Tencent Cloud Mini Program Platform Renamed to Tencent Cloud Super App as a Service on January 2, 2025
Console Updates
Android SDK Updates
iOS SDK Updates
Flutter SDK Updates
IDE Updates
Base Library Updates
Product Introduction
Overview
Strengths
Use Cases
Purchase Guide
Billing Overview
Pay-As-You-Go Billing
Renewal Guide
Service Suspension Instructions
Getting Started
Plan Management
Overview
Console Account Management
Storage Configuration
Acceleration Configuration
Branding Configurations
Platform Features
Console Login
Users and Permission System
Mini Program Management
Mini Game Management
Superapp Management
Commercialization
Platform Management
User Management
Team Management
Operations Management
Security Center
Code Integration Guide
Getting Demo and SDK
Android
iOS
Flutter
Superapp Server
GUID Generation Rules
Mini Program Development Guide
Mini Program Introduction and Development Environment
Mini Program Code Composition
Guide
Framework
Components
API
Server Backend
JS SDK
Base Library
IDE Operation Instructions
Mini Game Development Guide
Guide
API
Server Backend
Practice Tutorial
Mini Program Login Practical Tutorial
Mini Program Subscription Message Practical Tutorial
Payment Practical Tutorial
Ad Integration Practical Tutorial
Mini Game Subscription Message Practical Tutorial
API Documentation
History
Introduction
API Category
Making API Requests
Operation Management APIs
User Management APIs
Team Management APIs
Sensitive API-Related APIs
Role Management APIs
Platform Management APIs
Other Console APIs
Mini Program or Mini Game APIs
Management-Sensitive APIs
Global Domain Management APIs
Superapp APIs
Data Types
Agreements
Service Level Agreement
Data Processing and Security Agreement
SDK Privacy Policy Module
SDK Data Processing and Security Agreement Module

Transparent Video

PDF
Focus Mode
Font Size
Last updated: 2025-11-26 15:35:01

createAnimationVideoContext

This API is used via AnimationVideoContext wx.createAnimationVideo(string id, Object this)
Feature Description: Creates an AnimationVideoContext object.
Parameter and Description:
string id: The id of the <animation-video> component.
Object this, "this" of the current component instance under custom components, used to operate the <animation-video> component within.
Return Value: AnimationVideoContext.

AnimationVideoContext

Feature Description: AnimationVideoContext instance, which can be obtained through wx.createAnimationVideo.
AnimationVideoContext is bound to an <animation-video> component through its id, thereby manipulating the corresponding <animation-video> component.
Sample Code
<view class="wrap">
<view class="card-area">
<view class="top-description border-bottom">
<view>Feature</view>
<view>play pause seek</view>
</view>
<view class="video-area">
<animation-video
id="myAnimationVideo"
path="{{leftAlphaSrcPath}}"
loop="{{loop}}"
resource-width="800"
resource-height="400"
canvas-style="width:200px;height:200px"
autoplay="{{autoplay}}"
bindstarted="onStarted"
bindended="onEnded"
></animation-video>
</view>
<button bindtap="play">
Play
</button>
<button bindtap="pause">
Pause
</button>
<button bindtap="seek">
Navigate to the 2-second mark of the animation.
</button>
</view>
</view>
Page({
onLoad() {
this.createCtx();
},
createCtx() {
this.myAnimationVideo = wx.createAnimationVideoContext('my-video');
},
play() {
this.myAnimationVideo?.play();
},
pause() {
this.myAnimationVideo?.pause();
},
seek() {
this.myAnimationVideo?.seek(2);
},
})

.play

This method is used via AnimationVideoContext.play().
Feature Description: Plays the video.

.pause

This method is used via AnimationVideoContext.pause().
Feature Description: Pauses the video.

.seek

This method is used via AnimationVideoContext.seek(number position).
Feature Description: Redirects to the specified position.
Parameter and Description: number position, the position to redirect to, unit: seconds.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback