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:
parent
3419230e89
commit
e8875f8362
1 changed files with 20 additions and 2 deletions
|
@ -1481,6 +1481,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||
}
|
||||
|
||||
list.push('SetBrightness');
|
||||
list.push("SetAspectRatio")
|
||||
|
||||
return list;
|
||||
}
|
||||
|
@ -1709,7 +1710,15 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||
};
|
||||
|
||||
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 () {
|
||||
|
@ -1717,7 +1726,16 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
|
|||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.getSupportedAspectRatios = function () {
|
||||
return [];
|
||||
return [{
|
||||
name: "Auto",
|
||||
id: "auto"
|
||||
}, {
|
||||
name: "Cover",
|
||||
id: "cover"
|
||||
}, {
|
||||
name: "Fill",
|
||||
id: "fill"
|
||||
}]
|
||||
};
|
||||
|
||||
HtmlVideoPlayer.prototype.togglePictureInPicture = function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue