mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 22:01:20 -08:00
artplayer@5.0.3
This commit is contained in:
1 parent
336627cae3
commit
217e83eac5
10 files changed
+13
-12
No files matched your search
@@ -3,7 +3,7 @@ import { query, clamp, append, setStyle, secondToTime, includeFromEvent, isMobil
|
||||
export function getPosFromEvent(art, event) {
|
||||
const { $progress } = art.template;
|
||||
const { left } = $progress.getBoundingClientRect();
|
||||
const eventLeft = isMobile ? event.touches[0].clientX : event.pageX;
|
||||
const eventLeft = isMobile ? event.touches[0].clientX : event.clientX;
|
||||
const width = clamp(eventLeft - left, 0, $progress.clientWidth);
|
||||
const second = (width / $progress.clientWidth) * art.duration;
|
||||
const time = secondToTime(second);
|
||||
|
||||
@@ -18,7 +18,7 @@ export default function volume(option) {
|
||||
|
||||
function getVolumeFromEvent(event) {
|
||||
const { top, height } = $slider.getBoundingClientRect();
|
||||
return 1 - (event.pageY - top) / height;
|
||||
return 1 - (event.clientY - top) / height;
|
||||
}
|
||||
|
||||
function update() {
|
||||
|
||||
Reference in new issue
Block a user