Fix some notice

This commit is contained in:
zhw2590582 committed 2022-02-11 20:40:25 +08:00
1 parent 1de2d2aaed
commit c9040e5eec
5 files changed
+36 -9

No files matched your search

+2 -1
View File
@@ -1,13 +1,14 @@
import { throttle } from '../utils';
export default function resizeInit(art, events) {
const { option } = art;
const { notice, option } = art;
const resizeFn = throttle(() => {
if (art.normalSize) {
art.autoSize = option.autoSize;
}
art.aspectRatioReset = true;
notice.show = '';
art.emit('resize');
}, 500);
+12 -2
View File
@@ -2,7 +2,10 @@ import screenfull from 'screenfull';
import { addClass, removeClass, def, get } from '../utils';
const nativeScreenfull = (art) => {
const { $player } = art.template;
const {
notice,
template: { $player },
} = art;
screenfull.on('change', () => art.emit('fullscreen', screenfull.isFullscreen));
@@ -18,6 +21,7 @@ const nativeScreenfull = (art) => {
art.autoSize = false;
art.emit('resize');
art.emit('fullscreen', true);
notice.show = '';
});
} else {
screenfull.exit().then(() => {
@@ -26,6 +30,7 @@ const nativeScreenfull = (art) => {
art.autoSize = art.option.autoSize;
art.emit('resize');
art.emit('fullscreen');
notice.show = '';
});
}
},
@@ -33,7 +38,10 @@ const nativeScreenfull = (art) => {
};
const webkitScreenfull = (art) => {
const { $video } = art.template;
const {
notice,
template: { $video },
} = art;
def(art, 'fullscreen', {
get() {
@@ -43,9 +51,11 @@ const webkitScreenfull = (art) => {
if (value) {
$video.webkitEnterFullscreen();
art.emit('fullscreen', true);
notice.show = '';
} else {
$video.webkitExitFullscreen();
art.emit('fullscreen');
notice.show = '';
}
},
});
@@ -1,7 +1,10 @@
import { addClass, removeClass, hasClass, def } from '../utils';
export default function fullscreenWebMix(art) {
const { $player } = art.template;
const {
notice,
template: { $player },
} = art;
def(art, 'fullscreenWeb', {
get() {
@@ -14,12 +17,14 @@ export default function fullscreenWebMix(art) {
art.autoSize = false;
art.emit('resize');
art.emit('fullscreenWeb', true);
notice.show = '';
} else {
removeClass($player, 'art-fullscreen-web');
art.aspectRatioReset = true;
art.autoSize = art.option.autoSize;
art.emit('resize');
art.emit('fullscreenWeb');
notice.show = '';
}
},
});