mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 19:06:15 -08:00
docs update
This commit is contained in:
1 parent
d26826401a
commit
53cbde0ff0
4 files changed
+43
-16
No files matched your search
@@ -640,17 +640,23 @@ var art = new Artplayer({
|
||||
});
|
||||
```
|
||||
|
||||
#### Class static properties
|
||||
#### Class static properties and methods
|
||||
|
||||
| Parameter | Description |
|
||||
| ------------------- | ------------------------- |
|
||||
| Artplayer.version | Version Information |
|
||||
| Artplayer.config | Configuration information |
|
||||
| Artplayer.utils | Common utils |
|
||||
| Artplayer.DEFAULTS | Default configuration |
|
||||
| Artplayer.instances | Instance collection |
|
||||
| Parameter | Description |
|
||||
| -------------------------------- | ------------------------- |
|
||||
| <code>Artplayer.version</code> | Version Information |
|
||||
| <code>Artplayer.config</code> | Configuration information |
|
||||
| <code>Artplayer.utils</code> | Common utils |
|
||||
| <code>Artplayer.DEFAULTS</code> | Default configuration |
|
||||
| <code>Artplayer.instances</code> | Instance collection |
|
||||
| <code>Artplayer.use()</code> | Function to load plugin |
|
||||
|
||||
#### Instance method
|
||||
#### Instance properties and methods
|
||||
|
||||
| Method | Parameter | Description |
|
||||
| -------------------------- | -------------------------------------- | ----------------------------------------------------- |
|
||||
| <code>art.init()</code> | | Initialization instance, in general you don't need it |
|
||||
| <code>art.destroy()</code> | <code>true</code> / <code>false</code> | Destroy instance, and whether to remove dom |
|
||||
|
||||
#### Listening event
|
||||
|
||||
|
||||
+13
-3
@@ -5245,6 +5245,8 @@
|
||||
createClass(Artplayer, [{
|
||||
key: "init",
|
||||
value: function init() {
|
||||
var _this2 = this;
|
||||
|
||||
this.isFocus = false;
|
||||
this.isPlaying = false;
|
||||
this.refs = {};
|
||||
@@ -5255,6 +5257,12 @@
|
||||
this.refs.$container = document.querySelector(this.option.container);
|
||||
}
|
||||
|
||||
if (Artplayer.instances.some(function (art) {
|
||||
return art.refs.$container === _this2.refs.$container;
|
||||
})) {
|
||||
errorHandle(false, 'Cannot mount multiple instances on the same dom element');
|
||||
}
|
||||
|
||||
this.template = new Template(this);
|
||||
this.storage = new Storage(this);
|
||||
this.i18n = new I18n(this);
|
||||
@@ -5359,8 +5367,8 @@
|
||||
style: {}
|
||||
},
|
||||
moreVideoAttr: {
|
||||
'controls': false,
|
||||
'preload': 'auto'
|
||||
controls: false,
|
||||
preload: 'auto'
|
||||
},
|
||||
lang: navigator.language.toLowerCase()
|
||||
};
|
||||
@@ -5370,7 +5378,9 @@
|
||||
return Artplayer;
|
||||
}(tinyEmitter);
|
||||
|
||||
Artplayer.instances = [];
|
||||
Object.defineProperty(Artplayer, 'instances', {
|
||||
value: []
|
||||
});
|
||||
window.Artplayer = Artplayer;
|
||||
|
||||
exports.default = Artplayer;
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"artplayer.js","sources":["../../packages/artplayer/node_modules/@babel/runtime/helpers/classCallCheck.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/createClass.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/typeof.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/inherits.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/defineProperty.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/objectSpread.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/iterableToArray.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/toConsumableArray.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/isNativeFunction.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/construct.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../packages/artplayer/src/utils/index.js","../../packages/artplayer/node_modules/option-validator/dist/option-validator.js","../../packages/artplayer/src/scheme/validElement.js","../../packages/artplayer/src/scheme/validStringEmpty.js","../../packages/artplayer/src/scheme/index.js","../../packages/artplayer/src/config/mimeCodec.js","../../packages/artplayer/src/config/mse.js","../../packages/artplayer/src/config/video.js","../../packages/artplayer/src/config/index.js","../../packages/artplayer/node_modules/tiny-emitter/index.js","../../packages/artplayer/src/template.js","../../packages/artplayer/src/i18n.js","../../packages/artplayer/src/player/mountUrlMix.js","../../packages/artplayer/src/player/attrInit.js","../../packages/artplayer/src/player/eventInit.js","../../packages/artplayer/src/player/playMix.js","../../packages/artplayer/src/player/pauseMin.js","../../packages/artplayer/src/player/toggleMix.js","../../packages/artplayer/src/player/seekMix.js","../../packages/artplayer/src/player/volumeMix.js","../../packages/artplayer/src/player/currentTimeMix.js","../../packages/artplayer/src/player/durationMix.js","../../packages/artplayer/src/player/switchMix.js","../../packages/artplayer/src/player/playbackRateMix.js","../../packages/artplayer/src/player/aspectRatioMix.js","../../packages/artplayer/src/player/screenshotMix.js","../../packages/artplayer/node_modules/screenfull/dist/screenfull.js","../../packages/artplayer/src/player/fullscreenMix.js","../../packages/artplayer/src/player/fullscreenWebMix.js","../../packages/artplayer/node_modules/get-size/get-size.js","../../packages/artplayer/node_modules/ev-emitter/ev-emitter.js","../../packages/artplayer/node_modules/unipointer/unipointer.js","../../packages/artplayer/node_modules/unidragger/unidragger.js","../../packages/artplayer/node_modules/draggabilly/draggabilly.js","../../packages/artplayer/src/player/pipMix.js","../../packages/artplayer/src/player/loadedMix.js","../../packages/artplayer/src/player/playedMix.js","../../packages/artplayer/src/player/autoSizeMix.js","../../packages/artplayer/src/player/flipMix.js","../../packages/artplayer/src/player/index.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/nonIterableRest.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/slicedToArray.js","../../packages/artplayer/src/icons/index.js","../../packages/artplayer/src/controls/fullscreen.js","../../packages/artplayer/src/controls/fullscreenWeb.js","../../packages/artplayer/src/controls/pip.js","../../packages/artplayer/src/controls/playAndPause.js","../../packages/artplayer/src/controls/progress.js","../../packages/artplayer/src/controls/subtitle.js","../../packages/artplayer/src/controls/time.js","../../packages/artplayer/src/controls/volume.js","../../packages/artplayer/src/controls/setting.js","../../packages/artplayer/src/controls/thumbnails.js","../../packages/artplayer/src/controls/screenshot.js","../../packages/artplayer/src/controls/quality.js","../../packages/artplayer/src/controls/index.js","../../packages/artplayer/src/contextmenu/playbackRate.js","../../packages/artplayer/src/contextmenu/aspectRatio.js","../../packages/artplayer/src/contextmenu/info.js","../../packages/artplayer/src/contextmenu/version.js","../../packages/artplayer/src/contextmenu/close.js","../../packages/artplayer/src/contextmenu/index.js","../../packages/artplayer/src/infoLine truncated
|
||||
{"version":3,"file":"artplayer.js","sources":["../../packages/artplayer/node_modules/@babel/runtime/helpers/classCallCheck.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/createClass.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/typeof.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/assertThisInitialized.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/possibleConstructorReturn.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/getPrototypeOf.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/setPrototypeOf.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/inherits.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/defineProperty.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/objectSpread.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/arrayWithoutHoles.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/iterableToArray.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/nonIterableSpread.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/toConsumableArray.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/isNativeFunction.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/construct.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/wrapNativeSuper.js","../../packages/artplayer/src/utils/index.js","../../packages/artplayer/node_modules/option-validator/dist/option-validator.js","../../packages/artplayer/src/scheme/validElement.js","../../packages/artplayer/src/scheme/validStringEmpty.js","../../packages/artplayer/src/scheme/index.js","../../packages/artplayer/src/config/mimeCodec.js","../../packages/artplayer/src/config/mse.js","../../packages/artplayer/src/config/video.js","../../packages/artplayer/src/config/index.js","../../packages/artplayer/node_modules/tiny-emitter/index.js","../../packages/artplayer/src/template.js","../../packages/artplayer/src/i18n.js","../../packages/artplayer/src/player/mountUrlMix.js","../../packages/artplayer/src/player/attrInit.js","../../packages/artplayer/src/player/eventInit.js","../../packages/artplayer/src/player/playMix.js","../../packages/artplayer/src/player/pauseMin.js","../../packages/artplayer/src/player/toggleMix.js","../../packages/artplayer/src/player/seekMix.js","../../packages/artplayer/src/player/volumeMix.js","../../packages/artplayer/src/player/currentTimeMix.js","../../packages/artplayer/src/player/durationMix.js","../../packages/artplayer/src/player/switchMix.js","../../packages/artplayer/src/player/playbackRateMix.js","../../packages/artplayer/src/player/aspectRatioMix.js","../../packages/artplayer/src/player/screenshotMix.js","../../packages/artplayer/node_modules/screenfull/dist/screenfull.js","../../packages/artplayer/src/player/fullscreenMix.js","../../packages/artplayer/src/player/fullscreenWebMix.js","../../packages/artplayer/node_modules/get-size/get-size.js","../../packages/artplayer/node_modules/ev-emitter/ev-emitter.js","../../packages/artplayer/node_modules/unipointer/unipointer.js","../../packages/artplayer/node_modules/unidragger/unidragger.js","../../packages/artplayer/node_modules/draggabilly/draggabilly.js","../../packages/artplayer/src/player/pipMix.js","../../packages/artplayer/src/player/loadedMix.js","../../packages/artplayer/src/player/playedMix.js","../../packages/artplayer/src/player/autoSizeMix.js","../../packages/artplayer/src/player/flipMix.js","../../packages/artplayer/src/player/index.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/arrayWithHoles.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/iterableToArrayLimit.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/nonIterableRest.js","../../packages/artplayer/node_modules/@babel/runtime/helpers/slicedToArray.js","../../packages/artplayer/src/icons/index.js","../../packages/artplayer/src/controls/fullscreen.js","../../packages/artplayer/src/controls/fullscreenWeb.js","../../packages/artplayer/src/controls/pip.js","../../packages/artplayer/src/controls/playAndPause.js","../../packages/artplayer/src/controls/progress.js","../../packages/artplayer/src/controls/subtitle.js","../../packages/artplayer/src/controls/time.js","../../packages/artplayer/src/controls/volume.js","../../packages/artplayer/src/controls/setting.js","../../packages/artplayer/src/controls/thumbnails.js","../../packages/artplayer/src/controls/screenshot.js","../../packages/artplayer/src/controls/quality.js","../../packages/artplayer/src/controls/index.js","../../packages/artplayer/src/contextmenu/playbackRate.js","../../packages/artplayer/src/contextmenu/aspectRatio.js","../../packages/artplayer/src/contextmenu/info.js","../../packages/artplayer/src/contextmenu/version.js","../../packages/artplayer/src/contextmenu/close.js","../../packages/artplayer/src/contextmenu/index.js","../../packages/artplayer/src/infoLine truncated
|
||||
@@ -83,8 +83,8 @@ class Artplayer extends Emitter {
|
||||
style: {}
|
||||
},
|
||||
moreVideoAttr: {
|
||||
'controls': false,
|
||||
'preload': 'auto'
|
||||
controls: false,
|
||||
preload: 'auto'
|
||||
},
|
||||
lang: navigator.language.toLowerCase()
|
||||
};
|
||||
@@ -113,6 +113,14 @@ class Artplayer extends Emitter {
|
||||
this.refs.$container = document.querySelector(this.option.container);
|
||||
}
|
||||
|
||||
if (
|
||||
Artplayer.instances.some(
|
||||
art => art.refs.$container === this.refs.$container
|
||||
)
|
||||
) {
|
||||
utils.errorHandle(false, 'Cannot mount multiple instances on the same dom element');
|
||||
}
|
||||
|
||||
this.template = new Template(this);
|
||||
this.storage = new Storage(this);
|
||||
this.i18n = new I18n(this);
|
||||
@@ -145,6 +153,9 @@ class Artplayer extends Emitter {
|
||||
}
|
||||
}
|
||||
|
||||
Artplayer.instances = [];
|
||||
Object.defineProperty(Artplayer, 'instances', {
|
||||
value: []
|
||||
});
|
||||
|
||||
window.Artplayer = Artplayer;
|
||||
export default Artplayer;
|
||||
Reference in new issue
Block a user