W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
解釋: 創(chuàng)建并返回 animation-video 上下文 animationVideo 對(duì)象。通過(guò) animationVideoId 跟一個(gè) animation-video 組件綁定,通過(guò)它可以操作一個(gè) animation-video 組件。Web 態(tài)說(shuō)明:詳見(jiàn) animation-video 組件 Web 態(tài)說(shuō)明。
String animationVideoId
AnimationVideo
<view class="wrap">
<animation-video
id="myAnimationVideo"
path="{{path}}"
loop="{{loop}}"
resource-width="800"
resource-height="400"
canvas-style="width:200px;height:200px"
autoplay="{{autoplay}}"
bindstarted="started"
bindended="ended">
</animation-video>
</view>
Page({
data: {
loop: true,
path: 'https://efe-h2.cdn.bcebos.com/ceug/resource/res/2020-1/1577964961344/003e2f0dcd81.mp4',
autoplay: true
},
onLoad() {
this.myAnimationVideo = swan.createAnimationVideo('myAnimationVideo');
// 創(chuàng)建出動(dòng)畫(huà)組件實(shí)例,使用詳見(jiàn) AnimationVideo (https://smartprogram.baidu.com/docs/develop/api/media/animationvideo_AnimationVideo/)
},
});
.video-area {
height: 2.18rem;
background: #343434;
display: flex;
align-items: center;
justify-content: center;
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: