I get the exact same error when trying to view youtube videos over wifi. However, it works flawlessly on 3G or EDGE. As of yet, I have not figured out the cause.
I have researched this so much i got tired of looking for an answer. Some of the threads indicated it has something to do with the wireless router setup.
If one googles "An error has occurred attempting to play media" you will get many hits with different causes and alledged solutions. None worked for me.
I'm having the same problem on 3G. Both with the mobile site and an app. Even tried doing the optimizing stuff, no go. Get the media error and then it says something about the connection disconnecting.