Fix scrub for safari
This commit is contained in:
parent
88862f22df
commit
c83c377e38
@ -88,11 +88,11 @@ export class ProgressLine {
|
|||||||
|
|
||||||
protected scrub(e: SUPEREVENT) {
|
protected scrub(e: SUPEREVENT) {
|
||||||
let offsetX: number;
|
let offsetX: number;
|
||||||
if(e instanceof TouchEvent) {
|
if(e instanceof MouseEvent) {
|
||||||
|
offsetX = e.offsetX;
|
||||||
|
} else { // touch
|
||||||
const rect = (e.target as HTMLElement).getBoundingClientRect();
|
const rect = (e.target as HTMLElement).getBoundingClientRect();
|
||||||
offsetX = e.targetTouches[0].pageX - rect.left;
|
offsetX = e.targetTouches[0].pageX - rect.left;
|
||||||
} else {
|
|
||||||
offsetX = e.offsetX;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrubTime = offsetX / this.container.offsetWidth * this.duration;
|
const scrubTime = offsetX / this.container.offsetWidth * this.duration;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user