Home  >  Article  >  WeChat Applet  >  WeChat applet uses video component to play video function example

WeChat applet uses video component to play video function example

小云云
小云云Original
2018-05-10 16:56:1034349browse

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.wxml

Copy code The code is as follows:

<video src="../../pages/video/movie.mp4" binderror="videoErrorCallback"></video>

② index.js

Page({
 data:{
  // text:"这是一个页面"
 },
 videoErrorCallback: function (e) {
  console.log(&#39;视频错误信息:&#39;+e.detail.errMsg);
 }
})

Related recommendations :


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!

Statement:
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