mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-23 05:41:20 -08:00
update
This commit is contained in:
1 parent
f8e07c4d25
commit
0141129c74
4 files changed
+9
-2
No files matched your search
@@ -22,8 +22,11 @@ export default function aspectRatioMix(art) {
|
||||
const ratioArray = ratio.split(':').map(Number);
|
||||
const { videoWidth, videoHeight } = $video;
|
||||
const { clientWidth, clientHeight } = $player;
|
||||
|
||||
const videoRatio = videoWidth / videoHeight;
|
||||
const playerRatio = clientWidth / clientHeight;
|
||||
const setupRatio = ratioArray[0] / ratioArray[1];
|
||||
|
||||
if (videoRatio > setupRatio) {
|
||||
const percentage = (setupRatio * videoHeight) / videoWidth;
|
||||
setStyle($video, 'width', `${percentage * 100}%`);
|
||||
@@ -35,6 +38,7 @@ export default function aspectRatioMix(art) {
|
||||
setStyle($video, 'height', `${percentage * 100}%`);
|
||||
setStyle($video, 'padding', `${(clientHeight - clientHeight * percentage) / 2}px 0`);
|
||||
}
|
||||
|
||||
$player.dataset.aspectRatio = ratio;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
.art-fullscreen-web {
|
||||
.art-fullscreen();
|
||||
.art-full(var(--art-fullscreen-web-index), fixed);
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
}
|
||||
Reference in new issue
Block a user