Monday, January 28, 2013

Stream Videos From Mac To AppleTV Without iTunes

I have been looking for a solution to stream videos from my iMac to Apple TV without needing to use iTunes.

I don't like to keep vidoes in iTunes because my iTunes library is already rather unwieldy. Adding gigabytes of videos to it, and then subjecting the bloated thing to Time Machine backup? Does not sound like fun. I could opt to not copy the videos into my iTunes library when I add them, but that same setting will apply to my music as well. No joy there. So how can I stream these videos?

First there was AirFlick, but that stopped working with Lion. Then I thought perhaps Mountain Lion's AirPlay Mirroring would do the trick, except my iMac isn't recent enough to use it. Bummer. I even purchased a copy of AirParrot to wirelessly use an AppleTV connected HDTV as a second monitor to a MacBook when it's in the same room as the TV. But no joy to streaming videos stored on an iMac, which is in an adjacent room.

Then a solution hit me. Here is what I did to set things up:

  1. Open Termninal, and create a symbolic link under /home/me/Sites/Videos, pointing to where I have my videos stored.
  2. Edit /etc/apache2/users/me.conf thusly (sudo required):
  3. # Adding the "*" at the end enables the server to serve up sub-directories.
    <Directory "/Users/me/Sites/*">
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
  4. Go to System Preferences > Sharing, and turn on Web Sharing.
  5. Turn on and configure AirPlay on my AppleTV.

Now, whenever I want to watch a video stored in my iMac on my HDTV, I just:

  1. Open up Safari on an iOS device, and browse to http://myimac.local/~me/videos. Better yet, bookmark it.
  2. From the simplistic index page generated by Apache, choose a video to play.
  3. Once the video starts to play on my mobile device, tap on the AirPlay icon and choose AppleTV.
  4. In a few seconds, the video will start playing on the AppleTV. At this point, I can use the Remote app or the Apple Remote to control the playback on AppleTV.

This solution works perfectly, except for when my iMac is asleep. To overcome this, I installed the free mWOL app on my iOS devices and configured them to be able to remotely wake up the iMac as needed to stream videos.

By the way, the last two steps about choosing AirPlay to AppleTV are optional, especially when using an iPad.

No comments: