mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
update aspectRatioReset
This commit is contained in:
1 parent
61cf68f0bc
commit
ad8c50ddd7
9 files changed
+91
-93
No files matched your search
@@ -2,23 +2,26 @@ import { addClass, removeClass, hasClass, def, append } from '../utils';
|
||||
|
||||
export default function fullscreenWebMix(art) {
|
||||
const {
|
||||
option,
|
||||
notice,
|
||||
constructor,
|
||||
template: { $container, $player },
|
||||
} = art;
|
||||
|
||||
let cssText = '';
|
||||
def(art, 'fullscreenWeb', {
|
||||
get() {
|
||||
return hasClass($player, 'art-fullscreen-web');
|
||||
},
|
||||
set(value) {
|
||||
if (value) {
|
||||
cssText = $player.style.cssText;
|
||||
if (constructor.FULLSCREEN_WEB_IN_BODY) {
|
||||
append(document.body, $player);
|
||||
}
|
||||
art.normalSize = 'fullscreenWeb';
|
||||
addClass($player, 'art-fullscreen-web');
|
||||
art.aspectRatioReset = true;
|
||||
art.aspectRatioReset();
|
||||
art.autoSize = false;
|
||||
art.emit('resize');
|
||||
art.emit('fullscreenWeb', true);
|
||||
@@ -27,9 +30,13 @@ export default function fullscreenWebMix(art) {
|
||||
if (constructor.FULLSCREEN_WEB_IN_BODY) {
|
||||
append($container, $player);
|
||||
}
|
||||
if (cssText) {
|
||||
$player.style.cssText = cssText;
|
||||
cssText = '';
|
||||
}
|
||||
removeClass($player, 'art-fullscreen-web');
|
||||
art.aspectRatioReset = true;
|
||||
art.autoSize = art.option.autoSize;
|
||||
art.aspectRatioReset();
|
||||
art.autoSize = option.autoSize;
|
||||
art.emit('resize');
|
||||
art.emit('fullscreenWeb', false);
|
||||
notice.show = '';
|
||||
|
||||
Reference in new issue
Block a user