You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ui-compose] Round up current position of ProgressStateWithTickInterval
Until this change, `currentPositionMs` and `bufferedPositionMs` were a direct value extracted from the underlying Player. This resulted in the consumer having to make decisions about how to round up the value for the final display (e.g. how to parse the milliseconds into the HH:MM:SS string).
Whatever the user has provided as the interval is most likely the granularity they desire for the `currentPositionMs` and `bufferedPositionMs`. And while we attempt to poll the Player at exactly this interval, it is not always possible to obtain a precise value that is a multiple of the interval (e.g. falls directly on the grid of [0, interval, 2xinterval, 3xinterval ...]).
This change ensures that the `currentPositionMs` and `bufferedPositionMs` returned by `ProgressStateWithTickInterval` is already rounded up correctly. Note that it will still act like a "stopwatch" and not jump to the next second/minute value until we are incredibly close to the boundary (i.e. not from 50% of the interval or 50% of the remaining minute). Instead, this boundary is defined at 10ms to account for any potential jitter in Player reporting its current position.
PiperOrigin-RevId: 781159734
0 commit comments