This article mainly introduces the function of using the video component to play videos in the WeChat applet, and analyzes the specific implementation techniques of the video component to play local mp4 short videos in the form of examples. I hope it can help everyone.
1. Effect display
##2. Key code
① index.wxmlCopy code The code is as follows:
<video src="../../pages/video/movie.mp4" binderror="videoErrorCallback"></video>
Page({ data:{ // text:"这是一个页面" }, videoErrorCallback: function (e) { console.log('视频错误信息:'+e.detail.errMsg); } })
Example of WeChat applet using audio component to play music function
WeChat applet page jump function
Detailed explanation of video, music, and picture components of WeChat mini program
The above is the detailed content of WeChat applet uses video component to play video function example. For more information, please follow other related articles on the PHP Chinese website!