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

Merge pull request #583 from Wunax/fix-player-aspect-ratio

Fixed set aspect ratio option in the player
This commit is contained in:
dkanada 2019-11-23 01:41:51 +09:00 committed by GitHub
commit dca0700770
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1477,6 +1477,7 @@ define(['browser', 'require', 'events', 'apphost', 'loading', 'dom', 'playbackMa
}
list.push('SetBrightness');
list.push("SetAspectRatio")
return list;
}
@ -1704,7 +1705,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 () {
@ -1712,7 +1721,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 () {