mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 06:31:20 -08:00
Fix some notice
This commit is contained in:
1 parent
1de2d2aaed
commit
c9040e5eec
5 files changed
+36
-9
No files matched your search
@@ -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);
|
||||
|
||||
|
||||
@@ -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 = '';
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user