add usePlugins

This commit is contained in:
Harvey Zack committed 2018-10-21 15:29:06 +08:00
1 parent 0c6a297ee7
commit 54eb34d291
11 files changed
+2177 -2057

No files matched your search

+10 -1
View File
@@ -20,7 +20,7 @@ export default class Player {
}
eventBind() {
const { events: { proxy }, refs: { $video } } = this.art;
const { events: { proxy }, refs: { $player, $video }, i18n, notice } = this.art;
config.video.events.forEach(eventName => {
proxy($video, eventName, event => {
@@ -74,11 +74,20 @@ export default class Player {
this.art.isPlaying = false;
this.art.controls.show();
this.art.mask.show();
if (this.art.option.loop) {
this.seek(0);
this.play();
}
});
this.art.on('video:error', () => {
this.art.isError = true;
this.art.isPlaying = false;
this.art.loading.hide();
this.art.controls.hide();
$player.classList.add('artplayer-error');
notice.show(i18n.get('Video load failed'), false);
this.art.destroy();
});
}