mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-19 19:51:20 -08:00
separate variable constants
This commit is contained in:
1 parent
57a14f63ac
commit
fc3abd7d1d
20 files changed
+143
-80
No files matched your search
@@ -22,20 +22,22 @@ export default class Control extends Component {
|
||||
|
||||
const {
|
||||
option,
|
||||
constructor,
|
||||
events: { proxy },
|
||||
template: { $player },
|
||||
} = art;
|
||||
|
||||
this.mouseMoveTime = Date.now();
|
||||
let activeTime = Date.now();
|
||||
|
||||
art.on('mousemove', () => {
|
||||
proxy($player, ['click', 'mousemove', 'touchstart', 'touchmove'], () => {
|
||||
this.show = true;
|
||||
removeClass($player, 'art-hide-cursor');
|
||||
addClass($player, 'art-hover');
|
||||
this.mouseMoveTime = Date.now();
|
||||
activeTime = Date.now();
|
||||
});
|
||||
|
||||
art.on('video:timeupdate', () => {
|
||||
if (art.playing && this.show && Date.now() - this.mouseMoveTime >= 3000) {
|
||||
if (art.playing && this.show && Date.now() - activeTime >= constructor.CONTROL_HIDE_TIME) {
|
||||
this.show = false;
|
||||
addClass($player, 'art-hide-cursor');
|
||||
removeClass($player, 'art-hover');
|
||||
|
||||
@@ -41,10 +41,10 @@ export default function progress(options) {
|
||||
|
||||
setStyle($played, 'backgroundColor', 'var(--theme)');
|
||||
|
||||
let indicatorSize = 14;
|
||||
let indicatorSize = art.constructor.INDICATOR_SIZE;
|
||||
|
||||
if (icons.indicator) {
|
||||
indicatorSize = 16;
|
||||
indicatorSize = art.constructor.INDICATOR_SIZE_ICON;
|
||||
append($indicator, icons.indicator);
|
||||
} else {
|
||||
setStyles($indicator, {
|
||||
@@ -53,7 +53,10 @@ export default function progress(options) {
|
||||
}
|
||||
|
||||
if (isMobile) {
|
||||
indicatorSize = 20;
|
||||
indicatorSize = art.constructor.INDICATOR_SIZE_MOBILE;
|
||||
if (icons.indicator) {
|
||||
indicatorSize = art.constructor.INDICATOR_SIZE_MOBILE_ICON;
|
||||
}
|
||||
}
|
||||
|
||||
setStyles($indicator, {
|
||||
|
||||
@@ -11,8 +11,8 @@ export default function volume(option) {
|
||||
} = art;
|
||||
|
||||
let isDroging = false;
|
||||
const panelWidth = 60; // 音量条宽度
|
||||
const handleWidth = 12; // 音量把手宽度
|
||||
const panelWidth = art.constructor.VOLUME_PANEL_WIDTH;
|
||||
const handleWidth = art.constructor.VOLUME_HANDLE_WIDTH;
|
||||
const $volume = append($control, icons.volume);
|
||||
const $volumeClose = append($control, icons.volumeClose);
|
||||
const $volumePanel = append($control, '<div class="art-volume-panel"></div>');
|
||||
|
||||
Reference in new issue
Block a user