mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 17:01:20 -08:00
Aspect ratio (#534)
* update * update * Create video2.mp4 * add art.quality * fix art.theme
This commit is contained in:
1 parent
1beff2c7fa
commit
4902322808
233 files changed
+2405
-2182
No files matched your search
@@ -1,23 +1,14 @@
|
||||
import { throttle, setStyle } from '../utils';
|
||||
import { throttle } from '../utils';
|
||||
|
||||
export default function resizeInit(art, events) {
|
||||
const {
|
||||
option,
|
||||
constructor,
|
||||
template: { $player },
|
||||
} = art;
|
||||
const { option, constructor } = art;
|
||||
|
||||
art.on('resize', () => {
|
||||
const { aspectRatio, notice } = art;
|
||||
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);
|
||||
if (art.state === 'standard' && option.autoSize) {
|
||||
art.autoSize();
|
||||
}
|
||||
art.aspectRatio = aspectRatio;
|
||||
notice.show = '';
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user