Merge pull request #4018 from dpalou/MOBILE-4566

Mobile 4566
main
Pau Ferrer Ocaña 2024-04-24 14:27:29 +02:00 committed by GitHub
commit 718e1b1733
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 2 deletions

View File

@ -165,6 +165,14 @@ export class AddonFilterMediaPluginVideoJSService {
const videoWidth = player.videoWidth(); const videoWidth = player.videoWidth();
const videoHeight = player.videoHeight(); const videoHeight = player.videoHeight();
const playerDimensions = player.currentDimensions(); 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) { if (!videoWidth || !videoHeight || !playerDimensions.width || videoWidth === playerDimensions.width) {
return; return;
} }

View File

@ -54,7 +54,7 @@ export class CoreMedia {
* @returns Whether needs conversion. * @returns Whether needs conversion.
*/ */
static sourceNeedsConversion(source: CoreMediaSource): boolean { static sourceNeedsConversion(source: CoreMediaSource): boolean {
if (!CorePlatform.isIOS()) { if (!CorePlatform.isMobile()) {
return false; return false;
} }
@ -84,7 +84,7 @@ export class CoreMedia {
* @returns Whether JS player should be used. * @returns Whether JS player should be used.
*/ */
static mediaUsesJavascriptPlayer(mediaElement: HTMLVideoElement | HTMLAudioElement): boolean { static mediaUsesJavascriptPlayer(mediaElement: HTMLVideoElement | HTMLAudioElement): boolean {
if (!CorePlatform.isIOS()) { if (!CorePlatform.isMobile()) {
return false; return false;
} }