diff --git a/README.html b/README.html new file mode 100644 index 000000000..d67322a7b --- /dev/null +++ b/README.html @@ -0,0 +1,863 @@ +
+
+
+
++ArtPlayer is a modern HTML5 video player
+
⚠️ This project is WIP and not ready for production use yet!
+$ npm install --save artplayer
+import Artplayer from 'artplayer'; +import 'artplayer/dist/artplayer.css'; +
OR umd builds are also available
+<link rel="stylesheet" href="path/to/artplayer.css" /> +<script src="path/to/artplayer.js"></script> +
Will expose the global variable to window.Artplayer.
<div class="artplayer-app"></div> +
var art = new Artplayer({ + container: '.artplayer-app', + url: 'path/to/video.mp4' +}); +
| parameter | +description | +Example | +||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
container |
+
+ Type: string, element+ Default: .artplayer+ Required: true+ DOM container of the player, you need to initialize a size for the container element + |
+ + Demo + | +||||||||||||
url |
+
+ Type: string+ Default: ''+ Required: true+ Video source url, Three video file formats are supported: mp4, ogg, webm
+ |
+ + Demo + | +||||||||||||
poster |
+
+ Type: string+ Default: ''+ Video poster image url + |
+ + Demo + | +||||||||||||
title |
+
+ Type: string+ Default: ''+ Video title, will be shown in screenshot file name and pip mode
+ |
+ + Demo + | +||||||||||||
volume |
+
+ Type: number+ Default: 0.7+ Default volume, player will cache the last volume, which may be overwritten + |
+ + Demo + | +||||||||||||
autoplay |
+
+ Type: boolean+ Default: false+ Whether to play automatically, sometimes it doesn't necessarily succeed + More info: autoplay-policy-changes + |
+ + Demo + | +||||||||||||
autoSize |
+
+ Type: boolean+ Default: false+ Keep the original video aspect ratio and automatically zoom + |
+ + Demo + | +||||||||||||
loop |
+
+ Type: boolean+ Default: false+ Automatic loop playback + |
+ + Demo + | +||||||||||||
playbackRate |
+
+ Type: boolean+ Default: false+ Whether to show playback rate controller in the contextmenu + |
+ + Demo + | +||||||||||||
aspectRatio |
+
+ Type: boolean+ Default: false+ Whether to show aspect ratio controller in the contextmenu + |
+ + Demo + | +||||||||||||
screenshot |
+
+ Type: boolean+ Default: false+ Whether to show screenshot controller in the bottom + |
+ + Demo + | +||||||||||||
setting |
+
+ Type: boolean+ Default: false+ Whether to show setting controller in the bottom + |
+ + Demo + | +||||||||||||
pip |
+
+ Type: boolean+ Default: false+ Whether to show pip controller in the bottom + |
+ + Demo + | +||||||||||||
fullscreen |
+
+ Type: boolean+ Default: false+ Whether to show window fullscreen controller in the bottom + |
+ + Demo + | +||||||||||||
fullscreenWeb |
+
+ Type: boolean+ Default: false+ Whether to show web page fullscreen controller in the bottom + |
+ + Demo + | +||||||||||||
hotkey |
+
+ Type: boolean+ Default: true+ Whether to use hotkey +
|
+ + Demo + | +||||||||||||
mutex |
+
+ Type: boolean+ Default: true+ Player mutually exclusive, only one player can play at a time + |
+ + Demo + | +||||||||||||
lang |
+
+ Type: string+ Default: navigator.language.toLowerCase()+ Default display language: en, zh-cn, zh-tw
+ |
+ + Demo + | +||||||||||||
theme |
+
+ Type: string+ Default: #f00+ Default theme color + |
+ + Demo + | +||||||||||||
subtitle |
+
+ Type: object+ Default: {}+ Custom subtitle +
|
+ + Demo + | +||||||||||||
thumbnails |
+
+ Type: object+ Default: {}+ Custom thumbnails in the progress bar with lazy load +
|
+ + Demo + | +||||||||||||
moreVideoAttr |
+
+ Type: object+ Default: {'controls': false,'preload': 'auto'}+ More video Attributes, these properties will be written directly to the video element + |
+ + Demo + | +||||||||||||
quality |
+
+ Type: array+ Default: []+ Custom quality, The type of quality is an object +
|
+ + Demo + | +||||||||||||
highlight |
+
+ Type: array+ Default: []+ Custom highlight, The type of highlight is an object +
|
+ + Demo + | +||||||||||||
layers |
+
+ Type: array+ Default: []+ Custom layer, The type of layer is an object or function+
|
+ + Demo + | +||||||||||||
contextmenu |
+
+ Type: array+ Default: []+ Custom contextmenu, The type of layer is an object or function+
|
+ + Demo + | +||||||||||||
controls |
+
+ Type: array+ Default: []+ Custom controls, The type of controls is an object +
|
+ + Demo + | +
| Project | +Description | +
|---|---|
| artplayer-plugin-danmu | +Danmu plugin for ArtPlayer | +
MIT © Harvey Zack
+ +mp4, ogg, webm
screenshot file name and pip mode
en, zh-cn, zh-tw
`,
click: function () {
- app.destroy(true);
- app = new Artplayer({
+ art.destroy(true);
+ art = new Artplayer({
autoplay: true,
container: '.artplayer-app',
url: url + '/video/you-name.mp4'