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 width based on the aspect ration of the video.
Full width
By setting the following style:
tsxstyle={{ width: "100%" }}
tsxstyle={{ width: "100%" }}
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
tsxstyle={{ width: "100%", height: "100%" }}
tsxstyle={{ width: "100%", height: "100%" }}
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.