aspectRatio property
double
aspectRatio
Returns size.width
/ size.height
when the player is initialized, or 1.0.
when
the player is not initialized or the aspect ratio would be less than or equal to 0.0.
Implementation
double get aspectRatio {
if (!isInitialized || size.width == 0 || size.height == 0) {
return 1.0;
}
final aspectRatio = size.width / size.height;
if (aspectRatio <= 0) {
return 1.0;
}
return aspectRatio;
}