add art.isLock

This commit is contained in:
Harvey committed 2022-05-16 13:09:08 +08:00
1 parent 2189a41334
commit 2c5ba00521
11 files changed
+214 -167

No files matched your search

+3 -1
View File
@@ -26,7 +26,9 @@ export default function clickInit(art, events) {
art.emit('dblclick');
if (isMobile) {
art.toggle();
if (!art.isLock) {
art.toggle();
}
} else {
art.fullscreen = !art.fullscreen;
}
+1
View File
@@ -36,6 +36,7 @@ export default class Artplayer extends Emitter {
const mergeOption = utils.mergeDeep(Artplayer.option, option);
this.option = validator(mergeOption, scheme);
this.isLock = false;
this.isReady = false;
this.isFocus = false;
this.isInput = false;
@@ -11,7 +11,7 @@ export default function fastForward(art) {
let isPress = false;
const onStart = (event) => {
if (event.touches.length === 1 && art.playing) {
if (event.touches.length === 1 && art.playing && !art.isLock) {
timer = setTimeout(() => {
isPress = true;
art.playbackRate = constructor.FAST_FORWARD_VALUE;
+2
View File
@@ -27,9 +27,11 @@ export default function lock(art) {
click() {
if (hasClass($player, 'art-lock')) {
removeClass($player, 'art-lock');
this.isLock = false;
art.emit('lock', false);
} else {
addClass($player, 'art-lock');
this.isLock = true;
art.emit('lock', true);
}
},