3
\$\begingroup\$

I am able to play a video in windows in my project, but the same code fails on the XBOX at the _player.Play(_logo) line. The error message is:

"An unhandled exception of type 'System.InvalidOperationException' occurred in Microsoft.Xna.Framework.dll"

Relevant code:

    public LogoScreen()
    {
        TransitionOnTime = TimeSpan.Zero;
        TransitionOffTime = TimeSpan.Zero;

        _content = new ContentManager(Game3.Instance.Services, "Content");

        _player = new VideoPlayer();
        _player.IsLooped = false;

        _sb = new SpriteBatch(Game3.GDM.GraphicsDevice);
    }

    public override void LoadContent()
    {
        _logo = _content.Load<Video>("Video/intro_logo");
    }

    private bool _started = false;
    public override void Update(bool otherScreenHasFocus, 
        bool coveredByOtherScreen, bool coveredByPopup)
    {
        if(_started == false)
        {
            _player.Play(_logo);
            _started = true;
        }

        if (_player.State == MediaState.Stopped)
        {
            Exit();
        }
    }

Here is the random test video that I'm using: http://olhovsky.com/xna/intro_logo.wmv

Any ideas why this might be failing?

\$\endgroup\$
3
\$\begingroup\$

The XBOX is very picky about which WMVs it will play. The fix is to encode a WMV with Windows Movie Maker -- encoding in After Effects creates WMVs that the XBOX 360 will not play.

Edit: I believe the problem more specifically, is that the bitrate must be 12000kbps or less, for XBOX 360 playback.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.