mirror of
https://github.com/zhw2590582/ArtPlayer.git
synced 2026-10-22 21:31:20 -08:00
update
This commit is contained in:
1 parent
47438ed73f
commit
db06e9a8c5
3 files changed
+8
-5
No files matched your search
@@ -1147,20 +1147,21 @@
|
||||
$player = _this$art8$refs.$player,
|
||||
i18n = _this$art8.i18n,
|
||||
notice = _this$art8.notice;
|
||||
var ratioName = ratio.length === 2 ? "".concat(ratio[0], ":").concat(ratio[1]) : ratio[0];
|
||||
|
||||
if (ratio.length === 2) {
|
||||
var rate = Number(ratio[0]) / Number(ratio[1]);
|
||||
setStyle($video, 'width', "".concat(100 / rate, "%"));
|
||||
setStyle($video, 'height', '100%');
|
||||
setStyle($video, 'padding', "0 ".concat(($player.clientWidth - $player.clientWidth / rate) / 2, "px"));
|
||||
$player.dataset.aspectRatio = ratioName;
|
||||
} else {
|
||||
setStyle($video, 'width', null);
|
||||
setStyle($video, 'height', null);
|
||||
setStyle($video, 'padding', null);
|
||||
delete $player.dataset.aspectRatio;
|
||||
}
|
||||
|
||||
var ratioName = ratio.length === 2 ? "".concat(ratio[0], ":").concat(ratio[1]) : ratio[0];
|
||||
$player.dataset.aspectRatio = ratioName;
|
||||
notice.show("".concat(i18n.get('Aspect ratio'), ": ").concat(ratioName));
|
||||
this.art.emit('aspectRatio', ratio);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user