I'm can't really explain why that is happening, the only suggestion I can make is if you are using Windows Media Player
to try and play those types of file that you can use VLC Media Player.
I use it to play .avi files without any problems at all.
Glad to hear that VLC worked for you. Here is some info on what a codec is.
Probably the most popular codec pack is the K-Lite Codec Pack, downloading it will allow you to play many more types of files with Windows Media Player.
I prefer VLC because it has all of those codecs built in instead of running two different programs to play one file though.