Detailed explanation of mini-program video components and instance code, mini-program video
There is no difference between the video playback component and the image loading component.
Important attributes:
Wxml
<! -- Listen to the button click event --> <button bindtap = "listenerButton"> click to display the video component </button> <! -- Video component src resource address, binderror for listening error information --> <video src = "http://mvvideo1.meitudata.com/575c2b652d7375255.mp4" style = "width: 100%; height: 100% "hidden =" {hiddenVideo} "binderror =" listenerVideo "/>
Js
Page ({data: {// text: "This is a Page" hiddenVideo: true},/*** listens to the video loading error status */listenerVideo: function (e) {console. log (e. detail. errMsg) ;},/*** listen to the button click event */listenerButton: function () {this. setData ({hiddenVideo :! This. data. hiddenVideo })}})
Related Articles:
Hello WeApp icon component
Window text Component switch component
Tabss component action-sheet
Application lifecycle button Component modal component
Page lifecycle checkbox component toast component
Modular Details form component details loading component
Data Binding input component navigator component
View component picker component audio component
Scroll-view component radio component video component
Swiper component slider component Image component