1.2.1 • Published 5 years ago
h5-video-player v1.2.1
H5 Video Player
Browser full screen H5 video player. (Releases | Demo)
This package has been deprecated
This package has been migrated to @cycjimmy/h5-video-player for scoped NPM package. Please switch to @cycjimmy/h5-video-player to stay up to date.
Install
$ npm install h5-video-player --save
# or
$ yarn add h5-video-player
Use
import H5VideoPlayer from 'h5-video-player';
# OR
const H5VideoPlayer = require('h5-video-player');
const videoPlayer = new H5VideoPlayer(source, [, options]);
videoPlayer.load();
source
: Video source allows three typesoptions
context
: Element|String Context Wrapper Element. Default'body'
.control
: Boolean Whether the user can control. Defaultfalse
.autoPlay
: Boolean Whether to play immediately after loading. Defaultfalse
.autoClose
: Boolean Whether to close immediately when the video played off. Defaulttrue
.preload
: Boolean Whether to preload the video. Defaulttrue
.orientation
: String landscape / portrait. Default'portrait'
.aspectRatio
: Number Set video aspect ratio. Default9 / 16
(when orientation is portrait) or16 / 9
(when orientation is landscape).disableRotation
: Boolean Whether to prohibit automatic rotation. Defaultfalse
.picMode
: Boolean picture mode (no playButton). Defaultfalse
.fixAndroidWechatContinue
: Boolean Whether compatible with Wechat(Android) play after Forced to pause. Defaultfalse
.hookInPlay
: Function The hook function when the video play.hookInPause
: Function The hook function when the video pause.hookInStop
: Function The hook function when the video stop.
function
load()
: init videoplay()
: video playpause()
: video pause
Use in browser
<div id="videoWrapper"></div>
<script src="H5VideoPlayer.min.js"></script>
<script>
var source = 'media/video.mp4';
var video = new H5VideoPlayer(source, {
context: '#videoWrapper',
[...options]
}).load();
</script>
CDN
To use via a CDN include this in your html:
<script src="https://cdn.jsdelivr.net/npm/h5-video-player@1/build/H5VideoPlayer.min.js"></script>
1.2.1
5 years ago
1.2.0
5 years ago
1.1.2
6 years ago
1.1.1
6 years ago
1.1.0
6 years ago
1.0.0
6 years ago
0.2.0
7 years ago
0.1.8
7 years ago
0.1.7
7 years ago
0.1.6
7 years ago
0.1.4
7 years ago
0.1.2
7 years ago
0.1.1
7 years ago
0.1.0
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago