mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-24 23:51:20 -08:00
remove player object
This commit is contained in:
1 parent
59a8ccce81
commit
59400eb3bf
58 files changed
+295
-313
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { setStyle, hasClass, addClass, removeClass, def } from '../utils';
|
||||
|
||||
export default function autoHeightMix(art, player) {
|
||||
export default function autoHeightMix(art) {
|
||||
const {
|
||||
option,
|
||||
template: { $container, $video },
|
||||
@@ -8,7 +8,7 @@ export default function autoHeightMix(art, player) {
|
||||
|
||||
const heightCache = $container.style.height;
|
||||
|
||||
def(player, 'autoHeight', {
|
||||
def(art, 'autoHeight', {
|
||||
get() {
|
||||
return hasClass($container, 'art-auto-height');
|
||||
},
|
||||
@@ -19,12 +19,12 @@ export default function autoHeightMix(art, player) {
|
||||
const height = videoHeight * (clientWidth / videoWidth);
|
||||
setStyle($container, 'height', height + 'px');
|
||||
addClass($container, 'art-auto-height');
|
||||
player.autoSize = option.autoSize;
|
||||
art.autoSize = option.autoSize;
|
||||
art.emit('autoHeight', height);
|
||||
} else {
|
||||
setStyle($container, 'height', heightCache);
|
||||
removeClass($container, 'art-auto-height');
|
||||
player.autoSize = option.autoSize;
|
||||
art.autoSize = option.autoSize;
|
||||
art.emit('autoHeight');
|
||||
}
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user