5.6 VideoPlayer duration of URL

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?

Here is my solution to get the total length of a video by using URL, i made use of C# System.TimeSpan

void TotalTimeOfVideo()
        double time = videoplayer.frameCount / videoplayer.frameRate;
        System.TimeSpan VideoUrlLength = System.TimeSpan.FromSeconds(time);
        string minutes = (VideoUrlLength.Minutes).ToString("00");
        string seconds = (VideoUrlLength.Seconds).ToString("00");
        TotalMinutes.text = minutes;
        TotalSeconds.text = seconds;