-
Notifications
You must be signed in to change notification settings - Fork 22
Description
Sumary
Currently, VideoMetadata.duration is documented / expected to return the video duration in milliseconds (ms). However, in practice, the value returned is in seconds.
After investigation, the duration ultimately comes from AVPlayerItem.duration on macOS, which is a CMTime. The value is converted using CMTimeGetSeconds(...), which by definition returns a Double in seconds, not milliseconds.
This results in a unit mismatch between the API contract and the actual behavior, which can easily lead to incorrect calculations (e.g. progress bars, seek positions, or cross-platform duration handling).
Expected behavior
VideoMetadata.duration should return the duration in milliseconds, as originally intended.
Actual behavior
VideoMetadata.duration returns a value in seconds.