How to get video resolution

Hello world! (I'd always wanted to address people like that :))

I'd like to know how to get the resolution of a video I load at runtime using the WWW class (video is not in the resources/assets folder). At least I think I need its aspect ratio... I want to fit the video into fullscreen as large as possible (without distortion or cropping).

Any suggestions?

If you have a reference to the movietexture, you get width and height properties for it.

Then you can just do:

yourMovieTexture.width / yourMovieTexture.height

to get the aspect ratio

These properties deliver 16x16 resolution of a ogv video, which is actually a bit larger :)

private void LoadFullscreenVideo(string filename)
{
    string pathPrefix = @"file://";
    string fullFilename = pathPrefix + filename;

    WWW www = new WWW(fullFilename);

    fullscreenVideo = www.movie;

    //TODO: movie texture  width and height aren't set yet!
    int videoWidth = fullscreenVideo.width;
    int videoHeight = fullscreenVideo.height;
    Debug.Log("video width x height = " + videoWidth + " x " + videoHeight);

    //if aspect ratio of screen is different to video aspect ratio, use FitIn
    if ( Mathf.Abs(videoWidth / (float)videoHeight - Screen.width / (float)Screen.height) > Mathf.Epsilon )
        FitIn(videoWidth, videoHeight);

    fullscreenVideo.Play();
    renderer.enabled = false;
}

So what's wrong with these lines? The video seems to play in its original resolution...