mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-28 10:31:20 -08:00
update docs
This commit is contained in:
1 parent
2749d50209
commit
550aa0e7f2
95 files changed
+1734
-1828
No files matched your search
@@ -1,17 +1,18 @@
|
||||
import { throttle } from '../utils';
|
||||
|
||||
export default function resizeInit(art, events) {
|
||||
const { option } = art;
|
||||
const { option, constructor } = art;
|
||||
|
||||
const resizeFn = throttle(() => {
|
||||
if (art.state === 'standard') {
|
||||
art.autoSize = option.autoSize;
|
||||
art.on('resize', () => {
|
||||
const { aspectRatio, notice } = art;
|
||||
art.aspectRatio = aspectRatio;
|
||||
if (art.state === 'standard' && option.autoSize) {
|
||||
art.autoSize();
|
||||
}
|
||||
art.aspectRatioReset();
|
||||
art.notice.show = '';
|
||||
art.emit('resize');
|
||||
}, art.constructor.RESIZE_TIME);
|
||||
notice.show = '';
|
||||
});
|
||||
|
||||
const resizeFn = throttle(() => art.emit('resize'), constructor.RESIZE_TIME);
|
||||
events.proxy(window, ['orientationchange', 'resize'], () => resizeFn());
|
||||
if (screen && screen.orientation && screen.orientation.onchange) {
|
||||
events.proxy(screen.orientation, 'change', () => resizeFn());
|
||||
|
||||
Reference in new issue
Block a user