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; } diff --git a/src/core/singletons/media.ts b/src/core/singletons/media.ts index cdf487cac..eebca8793 100644 --- a/src/core/singletons/media.ts +++ b/src/core/singletons/media.ts @@ -54,7 +54,7 @@ export class CoreMedia { * @returns Whether needs conversion. */ static sourceNeedsConversion(source: CoreMediaSource): boolean { - if (!CorePlatform.isIOS()) { + if (!CorePlatform.isMobile()) { return false; } @@ -84,7 +84,7 @@ export class CoreMedia { * @returns Whether JS player should be used. */ static mediaUsesJavascriptPlayer(mediaElement: HTMLVideoElement | HTMLAudioElement): boolean { - if (!CorePlatform.isIOS()) { + if (!CorePlatform.isMobile()) { return false; }