mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-20 04:01:20 -08:00
fix mobile control click event
This commit is contained in:
1 parent
0f99168529
commit
86d083dcc2
4 files changed
+29
-10
No files matched your search
@@ -127,15 +127,24 @@ export default function progress(options) {
|
||||
setBar('played', 1);
|
||||
});
|
||||
|
||||
if (!isMobile) {
|
||||
proxy($control, 'click', (event) => {
|
||||
if (event.target !== $indicator) {
|
||||
proxy($control, 'click', (event) => {
|
||||
if (event.target !== $indicator) {
|
||||
const autoOrientation = art.plugins.autoOrientation && art.plugins.autoOrientation.state;
|
||||
if (autoOrientation) {
|
||||
const { clientHeight } = document.documentElement;
|
||||
const percentage = event.pageY / clientHeight;
|
||||
const second = percentage * art.duration;
|
||||
setBar('played', percentage);
|
||||
art.seek = second;
|
||||
} else {
|
||||
const { second, percentage } = getPosFromEvent(art, event);
|
||||
setBar('played', percentage);
|
||||
art.seek = second;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (!isMobile) {
|
||||
proxy($control, 'mousemove', (event) => {
|
||||
setStyle($tip, 'display', 'block');
|
||||
if (includeFromEvent(event, $highlight)) {
|
||||
|
||||
Reference in new issue
Block a user