diff --git a/src/addons/filter/mediaplugin/services/videojs.ts b/src/addons/filter/mediaplugin/services/videojs.ts index 2bfb87f8f..2b5ea07e7 100644 --- a/src/addons/filter/mediaplugin/services/videojs.ts +++ b/src/addons/filter/mediaplugin/services/videojs.ts @@ -165,6 +165,14 @@ export class AddonFilterMediaPluginVideoJSService { const videoWidth = player.videoWidth(); const videoHeight = player.videoHeight(); const playerDimensions = player.currentDimensions(); + const offsetParentWidth = player.el().offsetParent?.clientWidth; + + if (offsetParentWidth && playerDimensions.width > offsetParentWidth) { + // The player is bigger than the container. Resize it. + player.dimension('width', offsetParentWidth); + playerDimensions.width = offsetParentWidth; + } + if (!videoWidth || !videoHeight || !playerDimensions.width || videoWidth === playerDimensions.width) { return; }