diff --git a/src/components/htmlvideoplayer/plugin.js b/src/components/htmlvideoplayer/plugin.js index ee7087c3cc..f29ddb74c8 100644 --- a/src/components/htmlvideoplayer/plugin.js +++ b/src/components/htmlvideoplayer/plugin.js @@ -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 () {