In my Monogame project, I need to play a video. For this, I use the Video Class and VideoPlayer . But when I start the solution, VS gives me this error:
Error 1 Type "Microsoft.Xna.Framework.Media.Video" exists as in "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 the VideoPlayer class, which is located in Microsoft.Xna.Framework.Video.dll to play videos.
How can I solve this problem?
If this is useful, here is my code in which I want to play the 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; } } } } }
source share