In my Monogame project I need to play a video. For this I use Video Class
and VideoPlayer
class. But when I start solution, VS give me this error:
Error 1 The type 'Microsoft.Xna.Framework.Media.Video' exists in both 'c:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86\Microsoft.Xna.Framework.Video.dll' and 'c:\Program Files (x86)\MonoGame\v3.0\Assemblies\WindowsGL\MonoGame.Framework.dll'
I need VideoPlayer
class that it is in Microsoft.Xna.Framework.Video.dll for playing video.
How can I resolve this issue?
If it is helpful here is my code with I want to play video:
namespace play
{
public class PlayVideoClass
{
private readonly Microsoft.Xna.Framework.Media.Video _video;
private readonly Microsoft.Xna.Framework.Media.VideoPlayer _player;
private bool _playVideo;
public PlayVideoClass()
{
_video = Game1.Video;
_player = new Microsoft.Xna.Framework.Media.VideoPlayer();
_playVideo = true;
}
public void Update()
{
if (_playVideo)
{
if ((int) _player.State == (int)Microsoft.Xna.Framework.Media.MediaState.Stopped)
{
_player.Play( _video);
_playVideo = false;
}
}
}
}
}