I am trying to get the duration of a video specified via URL in the new VideoPlayer. I know that VideoClips have a duration, but there doesn’t seem to be an API for getting duration from a specified URL.
I have tried calculating it from frameCount and frameRate, ie
videoPlayer.prepareCompleted += (val) =>
{
duration = videoPlayer.frameCount / videoPlayer.frameRate;
}
but the value is off by a fraction of a second. Is there an accurate way to get the duration of video from a URL?