1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Fixed set aspect ratio option in the player

This commit is contained in:
Thomas Vandemeulebroucke 2019-11-20 15:13:15 +01:00
parent 3419230e89
commit e8875f8362

View file

@ -1481,6 +1481,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
} }
list.push('SetBrightness'); list.push('SetBrightness');
list.push("SetAspectRatio")
return list; return list;
} }
@ -1709,7 +1710,15 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
}; };
HtmlVideoPlayer.prototype.setAspectRatio = function (val) { HtmlVideoPlayer.prototype.setAspectRatio = function (val) {
var mediaElement = this._mediaElement;
if (mediaElement) {
if ("auto" === val) {
mediaElement.style.removeProperty("object-fit")
} else {
mediaElement.style["object-fit"] = val
}
}
this._currentAspectRatio = val
}; };
HtmlVideoPlayer.prototype.getAspectRatio = function () { HtmlVideoPlayer.prototype.getAspectRatio = function () {
@ -1717,7 +1726,16 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
}; };
HtmlVideoPlayer.prototype.getSupportedAspectRatios = function () { HtmlVideoPlayer.prototype.getSupportedAspectRatios = function () {
return []; return [{
name: "Auto",
id: "auto"
}, {
name: "Cover",
id: "cover"
}, {
name: "Fill",
id: "fill"
}]
}; };
HtmlVideoPlayer.prototype.togglePictureInPicture = function () { HtmlVideoPlayer.prototype.togglePictureInPicture = function () {