mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-08 10:56:15 -08:00
Update progress.js
This commit is contained in:
1 parent
62a6ba96ac
commit
201f7b7697
1 file changed
+1
-1
@@ -131,7 +131,7 @@ export default class Progress {
|
||||
getPos(event) {
|
||||
const { $video } = this.art.refs;
|
||||
const { left } = this.option.ref.getBoundingClientRect();
|
||||
const width = Math.max(0, event.x - left);
|
||||
const width = clamp(event.x - left, 0, this.option.ref.clientWidth);
|
||||
const second = width / this.option.ref.clientWidth * $video.duration;
|
||||
const time = secondToTime(second);
|
||||
const percentage = clamp(width / this.option.ref.clientWidth, 0, 1);
|
||||
|
||||
Reference in new issue
Block a user