Home > Article > WeChat Applet > Introduction to the video component in WeChat mini program
This article mainly introduces the detailed explanation and example code of the video component of the WeChat applet. Friends in need can refer to
Video playback component and image loading component There is no difference, and there is nothing to pay attention to when using it
Important attributes:
##wxml
<!--监听button点击事件--> <button bindtap="listenerButton">点击显示视频组件</button> <!--视频组件src资源地址,binderror为监听错误信息--> <video src="http://mvvideo1.meitudata.com/575c2b652d7375255.mp4" style="width: 100%; height: 100%" hidden="{{hiddenVideo}}" binderror="listenerVideo" />
js
Page({ data:{ // text:"这是一个页面" hiddenVideo: true }, /** * 监听视频加载错误状态 */ listenerVideo:function(e) { console.log(e.detail.errMsg); }, /** * 监听button点击事件 */ listenerButton:function() { this.setData({ hiddenVideo: !this.data.hiddenVideo }) } })
Related articles:
hello WeApp Icon componentWindow Progress component action-sheet
Application life cycle Button component Modal component
pagelifecycle Component
Data binding . audio component
scroll-view Components Radio Components Video Componentswiper Components Slider Components Image Component
The above is the entire content of this article. I hope it will be helpful to everyone's study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
WeChat applet Introduction to form components
The above is the detailed content of Introduction to the video component in WeChat mini program. For more information, please follow other related articles on the PHP Chinese website!