MOBILE-4566 media: Fix videojs videos wider than viewport
parent
aae5002b2c
commit
1808d9adfc
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue