Troubleshooting this TutorialSometimes, even though you try hard to understand the information in a tutorial, things don't work out quite like you want it to. This page is here to help you resolve any problems you might be having with the tutorial on video playback. The Common Mistakes section describes common problems that people have when doing the things in this tutorial, and how to resolve them. The Frequently Asked Questions section describes questions that people have that aren't related to mistakes, but rather, trying to understand the stuff better or exploring how it can be used. If your problem or concern isn't addressed here, feel free to add a comment below, so that I know where you're having trouble. I like to keep these pages fairly clean, so I may remove comments that I felt like have been addressed. If I remove your comment and you don't feel like the problem has been fixed, repost the question and we'll take another look at it. If a tutorial has a mistake in it, I will fix the mistake and reply to the comment with a brief explanation. However, after a couple of weeks I'll likely go back and remove the original comment as well as my reply, because, hopefully, the problem will have been fixed, and it won't be a concern any more. |
Common MistakesNone listed yet… |
Frequently Asked QuestionsNone listed yet… |
when i do apply this tut to my game, it gives an error that
The video format is unsupported. Please refer to the documentation for supported video formats.
Same error as the other guy. It reads
Error 1
Video file *Insert name here*.wmv is invalid. Please make sure that the video is not DRM protected and is a valid single-pass CBR encoded video file. C:\…
I've seen the error that you guys are talking about before. I don't remember the exact steps to fix it, but essentially I opened up the video in Windows Movie Maker and saved it again. Some movie files have certain settings that prevent XNA from being loaded. Putting it through Windows Movie Maker (or probably other ones as well) should fix the problem.
I'll see if I can get more specific directions for you guys soon.
Why doesn't XNA 4.0 offer a VideoPlayer class? Is there an alternate?
Hmm… I'm surprised to hear you say this, because from what I can tell, it looks like this exact code is working for me in XNA 4.0, VideoPlayer class and all. Do you have any other details about what's going on in your project, Gilad?
I'm expiriencing the same problem here, using XNA 4.0
I've checked some stuff to see why isn't XA familiar with the Video and VideoPlayer class. So I found out that Microsoft.Xna.Framework.Media has Video and VideoPlayer classes included inside of them. Yet I can't seem to figure out how to create an instance of these classes. so far I've tried: Microsoft.Xna.Framework.Media.Video and it didn't seem to be familiar with the Video part, so I'm out of ideas. Any suggestions?
Ok I got it. You just need to add a reference to the project itself. Go to your XNA installation foler -> 4.0 (or the version your using, as long as it's above 3.1) -> References -> Windows -> x86 or somehwere or there, and find the Microsoft.Xna.Framework.Video.dll file and add it. You can now create instances of the Video and VideoPlayer class!
I have the same problem (in MonoGame) and according to my findings online, the reason is that my project uses the OpenGL template: these two classes (Video and VideoPlayer) are unimplemented for it…
The following comment gives a (complicated?) workaround, which I have not tested at all.
(remove space)
community.monogame.net /t/videoplayer-class-is-missing/122/2
If someone has a simple solution, or can make the one from the above link work, then you are more than welcome to share it. I shall first try Shai’s one; by the way, I have the DLL in the two following paths, to be more specific:
C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Windows\x86
C:\Program Files (x86)\Microsoft XNA\XNA Game Studio\v4.0\References\Xbox360
Update: I tried adding the DLL, but it did not help. Then I tried with a DirectX project, and ran into… another error:
I guess this means that IsLooped is declared in an interface, but not implemented.
So I tried adding the DLL to the executable folder, but it did not work. Same story in the project folder.
Shai: without using Visual Studio, do you know which specific operations should be performed? I mean, where should the DLL file be added, and should some other file (such as the .csproj) be modified? Thanks to anyone who could help.
Post preview:
Close preview