mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-27 09:41:20 -08:00
fix: correct typos in player modules (#969)
This commit is contained in:
1 parent
169c6a318a
commit
078b595819
12 files changed
+39
-39
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { setStyle, def, getRect } from '../utils';
|
||||
|
||||
export default function resizeMix(art) {
|
||||
export default function autoSizeMix(art) {
|
||||
const { $container, $player, $video } = art.template;
|
||||
|
||||
def(art, 'autoSize', {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { def } from '../utils';
|
||||
|
||||
export default function seekMix(art) {
|
||||
export default function loadedMix(art) {
|
||||
const { $video } = art.template;
|
||||
|
||||
def(art, 'loaded', {
|
||||
|
||||
@@ -8,7 +8,7 @@ export default function miniMix(art) {
|
||||
template: { $player, $video },
|
||||
} = art;
|
||||
|
||||
let isDroging = false;
|
||||
let isDragging = false;
|
||||
let lastPageX = 0;
|
||||
let lastPageY = 0;
|
||||
|
||||
@@ -59,14 +59,14 @@ export default function miniMix(art) {
|
||||
art.on('video:timeupdate', () => initState($play, $pause));
|
||||
|
||||
proxy($mini, 'mousedown', (event) => {
|
||||
isDroging = event.button === 0;
|
||||
isDragging = event.button === 0;
|
||||
lastPageX = event.pageX;
|
||||
lastPageY = event.pageY;
|
||||
});
|
||||
|
||||
art.on('document:mousemove', (event) => {
|
||||
if (isDroging) {
|
||||
addClass($mini, 'art-mini-droging');
|
||||
if (isDragging) {
|
||||
addClass($mini, 'art-mini-dragging');
|
||||
const x = event.pageX - lastPageX;
|
||||
const y = event.pageY - lastPageY;
|
||||
setStyle($mini, 'transform', `translate(${x}px, ${y}px)`);
|
||||
@@ -74,9 +74,9 @@ export default function miniMix(art) {
|
||||
});
|
||||
|
||||
art.on('document:mouseup', () => {
|
||||
if (isDroging) {
|
||||
isDroging = false;
|
||||
removeClass($mini, 'art-mini-droging');
|
||||
if (isDragging) {
|
||||
isDragging = false;
|
||||
removeClass($mini, 'art-mini-dragging');
|
||||
const rect = getRect($mini);
|
||||
storage.set('left', rect.left);
|
||||
storage.set('top', rect.top);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { clamp, setStyle } from '../utils';
|
||||
|
||||
export default function attrInit(art) {
|
||||
export default function optionInit(art) {
|
||||
const {
|
||||
option,
|
||||
storage,
|
||||
|
||||
@@ -60,9 +60,9 @@ export default function thumbnailsMix(art) {
|
||||
const { url, scale } = option.thumbnails;
|
||||
if (!$thumbnails || !url) return;
|
||||
|
||||
const isMobileDroging = type === 'played' && event && isMobile;
|
||||
const isMobileDragging = type === 'played' && event && isMobile;
|
||||
|
||||
if (type === 'hover' || isMobileDroging) {
|
||||
if (type === 'hover' || isMobileDragging) {
|
||||
if (!loading) {
|
||||
loading = true;
|
||||
image = await loadImg(url, scale);
|
||||
@@ -82,7 +82,7 @@ export default function thumbnailsMix(art) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isMobileDroging) {
|
||||
if (isMobileDragging) {
|
||||
clearTimeout(timer);
|
||||
timer = setTimeout(() => {
|
||||
setStyle($thumbnails, 'display', 'none');
|
||||
|
||||
Reference in new issue
Block a user