add Artplayer.PROGRESS_HEIGHT

This commit is contained in:
Harvey Zack committed 2022-11-03 22:13:30 +08:00
1 parent 6f94ebade3
commit 3d72f2d95f
7 files changed
+26 -10

No files matched your search

+13 -4
View File
@@ -47,12 +47,21 @@ export default function progress(options) {
const $indicator = query('.art-progress-indicator', $control);
const $tip = query('.art-progress-tip', $control);
const {
PROGRESS_HEIGHT,
INDICATOR_SIZE,
INDICATOR_SIZE_ICON,
INDICATOR_SIZE_MOBILE,
INDICATOR_SIZE_MOBILE_ICON,
} = art.constructor;
setStyle($control, 'height', `${PROGRESS_HEIGHT}px`);
setStyle($played, 'backgroundColor', 'var(--theme)');
let indicatorSize = art.constructor.INDICATOR_SIZE;
let indicatorSize = INDICATOR_SIZE;
if (icons.indicator) {
indicatorSize = art.constructor.INDICATOR_SIZE_ICON;
indicatorSize = INDICATOR_SIZE_ICON;
append($indicator, icons.indicator);
} else {
setStyles($indicator, {
@@ -61,9 +70,9 @@ export default function progress(options) {
}
if (isMobile) {
indicatorSize = art.constructor.INDICATOR_SIZE_MOBILE;
indicatorSize = INDICATOR_SIZE_MOBILE;
if (icons.indicator) {
indicatorSize = art.constructor.INDICATOR_SIZE_MOBILE_ICON;
indicatorSize = INDICATOR_SIZE_MOBILE_ICON;
}
}
+1
View File
@@ -245,6 +245,7 @@ Artplayer.FAST_FORWARD_TIME = 1000;
Artplayer.TOUCH_MOVE_RATIO = 0.5;
Artplayer.VOLUME_STEP = 0.1;
Artplayer.SEEK_STEP = 5;
Artplayer.PROGRESS_HEIGHT = 4;
Artplayer.PLAYBACK_RATE = [0.5, 0.75, 1, 1.25, 1.5, 2];
Artplayer.ASPECT_RATIO = ['default', '4:3', '16:9'];
Artplayer.FLIP = ['normal', 'horizontal', 'vertical'];
+1
View File
@@ -58,6 +58,7 @@ declare class Artplayer extends Player {
static TOUCH_MOVE_RATIO: number;
static VOLUME_STEP: number;
static SEEK_STEP: number;
static PROGRESS_HEIGHT: number;
static PLAYBACK_RATE: number[];
static ASPECT_RATIO: string[];
static FLIP: string[];