mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-29 02:51:20 -08:00
压缩多余字符
This commit is contained in:
1 parent
707df15b2d
commit
0c1c1273a6
47 files changed
+356
-382
No files matched your search
@@ -7,7 +7,7 @@ export default function resizeMix(art, player) {
|
||||
|
||||
Object.defineProperty(player, 'autoSize', {
|
||||
get() {
|
||||
return hasClass($container, 'artplayer-auto-size');
|
||||
return hasClass($container, 'art-auto-size');
|
||||
},
|
||||
set(value) {
|
||||
if (value) {
|
||||
@@ -15,7 +15,7 @@ export default function resizeMix(art, player) {
|
||||
const { width, height } = $container.getBoundingClientRect();
|
||||
const videoRatio = videoWidth / videoHeight;
|
||||
const containerRatio = width / height;
|
||||
addClass($container, 'artplayer-auto-size');
|
||||
addClass($container, 'art-auto-size');
|
||||
if (containerRatio > videoRatio) {
|
||||
const percentage = ((height * videoRatio) / width) * 100;
|
||||
setStyle($player, 'width', `${percentage}%`);
|
||||
@@ -30,7 +30,7 @@ export default function resizeMix(art, player) {
|
||||
height: player.height,
|
||||
});
|
||||
} else {
|
||||
removeClass($container, 'artplayer-auto-size');
|
||||
removeClass($container, 'art-auto-size');
|
||||
setStyle($player, 'width', null);
|
||||
setStyle($player, 'height', null);
|
||||
art.emit('autoSizeRemove');
|
||||
|
||||
Reference in new issue
Block a user