Closed stephane-archer closed 2 weeks ago
@stephane-archer
Both, height
and width
are implemented as double
:
These properties are then being used in AspectRatio
as below:
Probably returning double
is more safe than returning these property values as int.
@darshankawar width
and height
are video resolution. the typical values would be 1920 and 1080 respectively. I don't think videos with 0,5 pixels exist. The associated AspectRatio
would be 16:9. here it makes sense to use a double
for this value but it's not because to calculate an AspectRatio
you need a floating point division that width
and height
should be defined as double
Thanks for the feedback.
height and width are double, are you aware of any floating point number resolution?
AVPlayer returns video sizes using doubles (CGSize
), so using an int would potentially destroy information from the platform level. Given that, plus the fact that altering the type now would be a breaking change, we will be keeping double
as the type. Clients can always round if they are not concerned about potential loss of precision if there are cases where AVPlayer returns non-integer values.
@stuartmorgan Do you have any idea why AVPlayer would return video sizes using doubles? Do I miss something?
Use case
height and width are double, are you aware of any floating point number resolution? I think int would be more appropriate.
Proposal
move to the right type