Importing Video via the ContentPipeline can only be done with WMV video files. It’s very hard to get the video format and encoding right, there is a lot of WMV importer complaining about corrupt files etc. But if you do get ‘em right the next hurdle is to get is displayed the right way.
I’m using a SpriteBatch to display the video, I’ve managed to display it with a scale, but different types of aspect ratio’s aren’t working yet.
Code:
private SpriteBatch _sb;
private Video _video;
private VideoPlayer _videoPlayer;
private Vector2 _videoPosition;
_sb = new SpriteBatch(TeddyGame.Graphics.GraphicsDevice);
_video = Content.Load<Video>(“filename”);
_videoPlayer = new VideoPlayer();
_videoPosition = new Vector2(_g.GraphicsDevice.Viewport.Width – (_video.Width / 10) – 10,0);
_sb.Draw(_videoPlayer.GetTexture(),
_videoPosition,
null,
Color.White,
0, //rotation
_videoPosition),
0.1f, //scale
SpriteEffects.None,
1);//index (front back)
Perhaps it’s possible to create a larger box around the video and change the ratio of the video and let the draw encapsulate it.
