mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-26 08:51:20 -08:00
add FULLSCREEN_WEB_IN_BODY
This commit is contained in:
1 parent
827be6ee02
commit
c733375d75
96 files changed
+183
-169
No files matched your search
@@ -251,6 +251,7 @@ Artplayer.PROGRESS_HEIGHT = 6;
|
||||
Artplayer.PLAYBACK_RATE = [0.5, 0.75, 1, 1.25, 1.5, 2];
|
||||
Artplayer.ASPECT_RATIO = ['default', '4:3', '16:9'];
|
||||
Artplayer.FLIP = ['normal', 'horizontal', 'vertical'];
|
||||
Artplayer.FULLSCREEN_WEB_IN_BODY = false;
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
if (!document.getElementById('artplayer-style')) {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { addClass, removeClass, hasClass, def } from '../utils';
|
||||
import { addClass, removeClass, hasClass, def, append } from '../utils';
|
||||
|
||||
export default function fullscreenWebMix(art) {
|
||||
const {
|
||||
notice,
|
||||
template: { $player },
|
||||
constructor,
|
||||
template: { $container, $player },
|
||||
} = art;
|
||||
|
||||
def(art, 'fullscreenWeb', {
|
||||
@@ -12,6 +13,9 @@ export default function fullscreenWebMix(art) {
|
||||
},
|
||||
set(value) {
|
||||
if (value) {
|
||||
if (constructor.FULLSCREEN_WEB_IN_BODY) {
|
||||
append(document.body, $player);
|
||||
}
|
||||
art.normalSize = 'fullscreenWeb';
|
||||
addClass($player, 'art-fullscreen-web');
|
||||
art.aspectRatioReset = true;
|
||||
@@ -20,6 +24,9 @@ export default function fullscreenWebMix(art) {
|
||||
art.emit('fullscreenWeb', true);
|
||||
notice.show = '';
|
||||
} else {
|
||||
if (constructor.FULLSCREEN_WEB_IN_BODY) {
|
||||
append($container, $player);
|
||||
}
|
||||
removeClass($player, 'art-fullscreen-web');
|
||||
art.aspectRatioReset = true;
|
||||
art.autoSize = art.option.autoSize;
|
||||
|
||||
Reference in new issue
Block a user