It depends on the file. There are at least two direct ways I know of to play what's on your computer on your HDTV. One way is to run an HDMI cord from your computer to the television if you have an HDMI port. You will have to go into settings to adjust the monitor to optimize it for the television aspect and make sure the sound output is to the television. If you have a newer Mac with OSX Mountain Lion, all you have to do is click on the icon at the top right side of your computer that looks like a black triangle in a rectangle. Select Apple TV, and whatever you have on your computer is now on the television, too. If it's a movie the sound will automatically play on the television. It works for presentations and pretty much everything else.
The whole idea behind this device is to stream to it. If you have an iPhone, iPad, Mac or Mac book pro, you can airplay to the apple tv or even show your display of your device up to the apple tv. For PC's, as long as you have iTunes installed on it, you can airplay from iTunes up to the apple tv. For a PC, you can try air parrot to airplay off of a MAC or PC to your apple tv. Just remeber to have the device you want to airplay from on the same wireless or hard wired network with your apple tv. If you have your iPhone on LTE for example with your wifi off, and your apple tv on wifi or hard wired. Airplay will not work. Since your iPhone is not on the wifi network with the apple tv device, you will not be able to airplay to it.
Everything goes through the iTunes Store or a connected Apple device, i.e. an iPad or Mac computer. Otherwise, you can circumvent the Apple TV altogether if your computer has an HDMI cord...then you can go straight from your computer to your television.
The itunes library can, through your wifi network, transfer/stream the movie to your TV if the Apple TV is connected via an HDMI cable to your TV. On itunes you must allow for home sharing to occur otherwise it won't work. There is another program, other than iTunes, that will allow a movie to be streamed to your TV. It's called AirFlick. It's free and can be downloaded via the internet. It works directly with your Apple TV.
Just an update- it IS possible to stream videos of any format to your AppleTV (not jailbroken!). It's a bit technical, but using PlexConnect you can do it. I'm doing it now. I feel like I have really unleashed the potential of this device!