playing movie embed in .fbx model

Feb 12, 2010 at 2:47 AM


I have a model of a rectangular wall which has movie embed in it iin .avi /.mpg format.But as soon as I import the model in xna, it gives error that importer doesnot support the movie format.

How can I load the model and play the movie?

Am i suppose to use jpeg sequence instead of avi, will it work... Has anyone tried it?




Pragya Anand

Jun 20, 2010 at 5:29 AM

Hi Pragya,

to play a video you have to install XNA 3.1 (or superior) as you have video support only since this version. I'm using "wmv" video.
It's reather easy:

//You run once this code:
  myVideoPlayer = new VideoPlayer();
  myVideo = Content.Load<Video>(@"intro1");
  //myVideo.Loop = false;

//In Draw method you do this (will run each frame):
  spriteBatch.Begin(SpriteBlendMode.AlphaBlend, SpriteSortMode.Deferred, SaveStateMode.SaveState);
  spriteBatch.Draw(videoPlayer.GetTexture(), new Rectangle(0, 0, device.Viewport.Width, device.Viewport.Height), Color.White);

That should work!