Scaling
The following algorithm is used for calculating the size of the Player:
- By default, the Player is as big as the composition height, defined by the compositionHeightandcompositionWidthprops.
- If heightandwidthis defined using thestyleproperty, the player will assume the dimensions you have passed.
- If a heightis passed using thestyleproperty, the player will assume that height, and calculate the width based on the aspect ratio of the video.
- If widthis passed using thestyleproperty, the player will assume that width and calculate the height based on the aspect ration of the video.
Full width
By setting the following style:
tsx
tsx
The video will scale to the full width of the parent container, while the height will be calculated based on the aspect ratio of the video.
Fitting to a container
You can use
tsx
tsx
to make the <Player /> fit the whole container. Note that if the player size does not match the video aspect ratio, the video gets scaled down and centered in the player.