This commit is contained in:
zhw2590582 committed 2021-11-28 14:24:10 +08:00
1 parent 454982ab4f
commit 4d73f41e38
6 files changed
+27 -1

No files matched your search

@@ -80,6 +80,26 @@ art.on('ready', () => {
});
```
## query
- 类型: `Function`
等于 `art.template.query`
<div className="run-code">▶ Run Code</div>
```js
var art = new Artplayer({
container: '.artplayer-app',
url: '/assets/sample/video.mp4',
});
art.on('ready', () => {
var $video = art.query('.art-video');
console.info($video);
});
```
## storage
- 类型: `Object`
+1
View File
@@ -8,6 +8,7 @@ export default class Notice {
}
set show(msg) {
if (!msg) return removeClass($player, 'art-notice-show');
const { $player, $noticeInner } = this.art.template;
$noticeInner.innerText = msg instanceof Error ? msg.message.trim() : msg;
addClass($player, 'art-notice-show');
@@ -14,6 +14,7 @@ export default function switchMix(art, player) {
player.flip = 'normal';
player.autoSize = option.autoSize;
player.currentTime = currentTime;
art.notice.show = '';
if (playing) {
player.play();
}
+1
View File
@@ -3,6 +3,7 @@ import { errorHandle, query, addClass } from './utils';
export default class Template {
constructor(art) {
this.art = art;
this.art.query = this.query.bind(this);
if (art.option.container instanceof Element) {
this.$container = art.option.container;