添加Demo自适应

This commit is contained in:
Harvey Zack committed 2018-11-21 16:05:09 +08:00
1 parent e9d7c0cfdc
commit f75e01be3b
8 files changed
+65 -13

No files matched your search

+18
View File
@@ -95,3 +95,21 @@ var art = new Artplayer({
}
]
});
art.on('resize', $player => {
art.controls.quality.show();
art.controls.setting.show();
art.controls.subtitle.show();
art.controls.pip.show();
var playerWidth = $player.clientWidth;
if (playerWidth < 480) {
art.controls.quality.hide();
art.controls.setting.hide();
}
if (playerWidth < 360) {
art.controls.subtitle.hide();
art.controls.pip.hide();
}
});