Home > WeChat Applet > Mini Program Development > Introduction to the video component in WeChat mini program

Introduction to the video component in WeChat mini program

不言
Release: 2018-06-23 10:26:01
Original
2580 people have browsed it

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" />
Copy after login

js

Page({
 data:{
 // text:"这是一个页面"
 hiddenVideo: true
 },
 /**
 * 监听视频加载错误状态
 */
 listenerVideo:function(e) {
  console.log(e.detail.errMsg);
 },
 /**
 * 监听button点击事件
 */
 listenerButton:function() {
  this.setData({
   hiddenVideo: !this.data.hiddenVideo
  })
 }

})
Copy after login

Related articles:

hello WeApp Icon component

Window 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 uses radio to display single option function [source code attached]

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template