mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-15 09:06:16 -08:00
update
This commit is contained in:
1 parent
30456c9873
commit
8aa7dc98df
4 files changed
+51
-31
No files matched your search
@@ -60,15 +60,11 @@ export default class Progress {
|
||||
});
|
||||
|
||||
proxy(this.option.ref, 'mousemove', event => {
|
||||
const { width, time } = this.getPos(event);
|
||||
if (width <= 20) {
|
||||
this.$timer.style.left = 0;
|
||||
} else if (width > this.option.ref.clientWidth - 20) {
|
||||
this.$timer.style.left = `${this.option.ref.clientWidth - 40}px`;
|
||||
if (event.path.indexOf(this.$highlight) > -1) {
|
||||
this.showHighlight();
|
||||
} else {
|
||||
this.$timer.style.left = `${width - 20}px`;
|
||||
this.showTime(event);
|
||||
}
|
||||
this.$timer.innerHTML = time;
|
||||
});
|
||||
|
||||
proxy(this.option.ref, 'click', event => {
|
||||
@@ -100,6 +96,22 @@ export default class Progress {
|
||||
});
|
||||
}
|
||||
|
||||
showHighlight() {
|
||||
console.log('showHighlight');
|
||||
}
|
||||
|
||||
showTime(event) {
|
||||
const { width, time } = this.getPos(event);
|
||||
if (width <= 20) {
|
||||
this.$timer.style.left = 0;
|
||||
} else if (width > this.option.ref.clientWidth - 20) {
|
||||
this.$timer.style.left = `${this.option.ref.clientWidth - 40}px`;
|
||||
} else {
|
||||
this.$timer.style.left = `${width - 20}px`;
|
||||
}
|
||||
this.$timer.innerHTML = time;
|
||||
}
|
||||
|
||||
getPos(event) {
|
||||
const { $video } = this.art.refs;
|
||||
const { left } = this.option.ref.getBoundingClientRect();
|
||||
|
||||
Reference in new issue
Block a user