Mui Player
Docs | 中文文档Introduction
MuiPlayer is an HTML5 video playback plugin. By default, it is equipped with beautiful playback controls, which cover common playback scenes, such as full-screen playback, fast-forward playback, looping playback, volume adjustment, video decoding and other functions.
Supports MP4, M3U8, FLV and other media formats to play, solve most compatibility problems, and adapt to the PC, mobile phone terminal playback.
MUIPlayer has a wealth of parameters to customize the player instance, through easy configuration to complete the custom scene video playback.
Features
MuiPlayer helped us solve some common problems in daily H5 Video application development:
- The ui of different browser platforms cannot be unified
- Conflicts between ui extensions and state processing are prone to
- In different environments (android, ios, pc), h5 video api may trigger events at different times
- There are various compatibility issues with media formats, muiplayer handles most of the compatibility issues when playing in different environments
- Repeated stepping on some pits in the process of developing h5 video, we provide a complete solution, so that developers can avoid some detours
installation
Install using npm:
npm i mui-player --save
Install using yarn:
yarn add mui-player
usage
1.Use the script tag to introduce:
<!-- import basic style files mui-player.min.css -->
<link rel="stylesheet" type="text/css" href="css/mui-player.min.css"/>
<!-- import basic script mui-player.min.js -->
<script type="text/javascript" src="js/mui-player.min.js"></script>
<!-- Specify the player container -->
<div id="mui-player"></div>
Or use the module manager to import:
import 'mui-player/dist/mui-player.min.css'
import MuiPlayer from 'mui-player'
2.Define the player container:
<div id="mui-player"></div>
3.Initialize and build the player:
// Initialize the MuiPlayer plugin. The MuiPlayer method passes an object that includes the configuration of all plug-ins.
var mp = new MuiPlayer({
container:'#mui-player',
title:'Title',
src:'./static/media/media.mp4',
})
The above can build a video player with default configuration controls for initialization. Below you can read some API basic configuration options about MuiPlayer. Go parameters API
Start
Install this project
npm install
npm start
Plugins
转载:https://blog.csdn.net/China_Guanq/article/details/115705226