這篇文章主要介紹了微信小程序 video組件詳解及實例代碼的相關資料,需要的朋友可以參考下
視頻播放組件與圖片加載組件也沒啥差別,使用起來也沒啥注意的
重要屬性:
wxml
<!--監(jiān)聽button點擊事件--> <button bindtap="listenerButton">點擊顯示視頻組件</button> <!--視頻組件src資源地址,binderror為監(jiān)聽錯誤信息--> <video src="http://mvvideo1.meitudata.com/575c2b652d7375255.mp4" style="width: 100%; height: 100%" hidden="{{hiddenVideo}}" binderror="listenerVideo" />
js
Page({ data:{ // text:"這是一個頁面" hiddenVideo: true }, /** * 監(jiān)聽視頻加載錯誤狀態(tài) */ listenerVideo:function(e) { console.log(e.detail.errMsg); }, /** * 監(jiān)聽button點擊事件 */ listenerButton:function() { this.setData({ hiddenVideo: !this.data.hiddenVideo }) } })
相關文章:
hello WeApp icon組件
Window text組件 switch組件
tabBar底部導航 progress組件 action-sheet
應用生命周期 button組件 modal組件
頁面生命周期 checkbox組件 toast組件
模塊化詳 form組件詳 loading 組件
數(shù)據(jù)綁定 input 組件 navigator 組件
View組件 picker組件 audio 組件
scroll-view組件 radio組件 video組件
swiper組件 slider組件 Image組件
以上就是本文的全部內容,希望對大家的學習有所幫助,更多相關內容請關注PHP中文網(wǎng)!
相關推薦:
以上就是微信小程序中video組件的介紹的詳細內容,更多請關注有卡有網(wǎng)。