Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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?

share|improve this question
    
This thread may help: forums.create.msdn.com/forums/p/33189/217676.aspx –  CiscoIPPhone Apr 6 '11 at 8:31

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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