mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-15 17:16:16 -08:00
update resizeInit
This commit is contained in:
1 parent
550aa0e7f2
commit
1beff2c7fa
5 files changed
+29
-14
No files matched your search
@@ -1,13 +1,22 @@
|
||||
import { throttle } from '../utils';
|
||||
import { throttle, setStyle } from '../utils';
|
||||
|
||||
export default function resizeInit(art, events) {
|
||||
const { option, constructor } = art;
|
||||
const {
|
||||
option,
|
||||
constructor,
|
||||
template: { $player },
|
||||
} = art;
|
||||
|
||||
art.on('resize', () => {
|
||||
const { aspectRatio, notice } = art;
|
||||
art.aspectRatio = aspectRatio;
|
||||
if (art.state === 'standard' && option.autoSize) {
|
||||
art.autoSize();
|
||||
if (art.state === 'standard') {
|
||||
art.aspectRatio = aspectRatio;
|
||||
if (option.autoSize) art.autoSize();
|
||||
} else {
|
||||
// TODO: 全屏时计算不准确
|
||||
art.aspectRatio = 'default';
|
||||
setStyle($player, 'width', null);
|
||||
setStyle($player, 'height', null);
|
||||
}
|
||||
notice.show = '';
|
||||
});
|
||||
|
||||
@@ -2,9 +2,9 @@ import { setStyle, def } from '../utils';
|
||||
|
||||
export default function aspectRatioMix(art) {
|
||||
const {
|
||||
template: { $video, $player },
|
||||
i18n,
|
||||
notice,
|
||||
template: { $video, $player },
|
||||
} = art;
|
||||
|
||||
def(art, 'aspectRatio', {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
.art-fullscreen-web {
|
||||
.art-fullscreen();
|
||||
.art-full(var(--art-fullscreen-web-index), fixed);
|
||||
width: 100% !important;
|
||||
}
|
||||
Reference in new issue
Block a user