Home > WeChat Applet > Mini Program Development > WeChat applet uses video component to play video function example

WeChat applet uses video component to play video function example

小云云
Release: 2018-05-10 16:56:10
Original
34400 people have browsed it

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

② index.js

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

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!

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