mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 18:41:20 -08:00
use ||
This commit is contained in:
1 parent
cafff9b155
commit
95ba1810b6
30 files changed
+447
-447
No files matched your search
@@ -18,12 +18,12 @@ export default function thumbnails(options) {
|
||||
function showThumbnails(event) {
|
||||
const { width: posWidth } = getPosFromEvent(art, event);
|
||||
const { url, number, column, width, height } = option.thumbnails;
|
||||
const width2 = width ?? image.naturalWidth / column;
|
||||
const height2 = height ?? width2 / ($video.videoWidth / $video.videoHeight);
|
||||
const width2 = width || image.naturalWidth / column;
|
||||
const height2 = height || width2 / ($video.videoWidth / $video.videoHeight);
|
||||
const perWidth = $progress.clientWidth / number;
|
||||
const perIndex = Math.floor(posWidth / perWidth);
|
||||
const yIndex = Math.ceil(perIndex / column) - 1;
|
||||
const xIndex = perIndex % column ?? column - 1;
|
||||
const xIndex = perIndex % column || column - 1;
|
||||
setStyle($control, 'backgroundImage', `url(${url})`);
|
||||
setStyle($control, 'height', `${height2}px`);
|
||||
setStyle($control, 'width', `${width2}px`);
|
||||
|
||||
Reference in new issue
Block a user