playing movie embed in .fbx model

Feb 12, 2010 at 2:47 AM

Hi,

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?

 

 

Thanks,

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;
  myVideoPlayer.Play(myVideo);

//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);
  spriteBatch.End();

That should work!
Synth