Stream Your iTunes Library To iPhone Over The Web [Mac]

Feb. 18th, 2009 By Jackson Chung

stream itunes library to iphoneThis is by no means a new tip. Many iPhone owners have been using this little “hack” to stream movies and music from iTunes. However, I thought it would be helpful if I were to repackage the instructions so that they are easier to follow. I’ve also added a few tips of my own.

Recently, I’ve been looking for a way to stream the movies and music in iTunes library to my iPhone. It can’t be that hard, I thought. Turns out, it isn’t. A simple hack discovered by Embraceware (the folks who brought you Awaken) turns your Mac into a server that is easily connectable from your iPhone (or iPod Touch or any other device for that matter).

Yes, I realize that there are some applications that are able to stream music and/or video to the iPhone. Simplify Media is a great app for instance, to stream music over the internet but personally, my music library is too large and I find that the Simplify Media server can’t take the load. I’m not totally sure if it can stream video too, by the way. Remote Buddy is an option if you want to stream video to your iPhone but it’s not free. Heck, it isn’t even cheap at 20€ ($25). Audiolizer is another service that lets you listen to iTunes library over the internet, but it requires you to upload the songs to its server.

Allow me to explain what this hack is all about. It enables a function on your Mac to turn it into a personal web server. You can then share anything you want on the local area network (LAN) – movies, music, files. It can also be accessible outside your LAN over the internet (be careful about this). It doesn’t have a gorgeous, graphical interface; it merely presents a list of your files.

What can this hack do? It can stream your iTunes library to iPhone. It can also stream your Movies in iTunes which are properly encoded (not the .mov reference movies) in h.264. They don’t even need to be formatted for the iPhone. It can also allow access to any folder on your Mac, serving you with documents or pictures you left at home.

OK, let’s get started. I’m writing this tutorial based on Leopard. Navigation in Tiger and previous OSes may be slightly different.

First, what we need to do is enable “Web Sharing” or previously known as “Personal Web Sharing”. Head over to System Preferences located on your Dock in Leopard. Tiger users can get to System Preferences by clicking on the Apple icon at the top-left corner. Once there, click on ‘Sharing’.

stream itunes library to iphone 3g

Check the box next to “Web Sharing” to enable it. Note your IP address shown on the right side. This is your internal IP if you have a router. Depending on whether you are connected via DHCP, your IP may change. If it does change, all you need to do is find out what your new IP is.

access itunes library from iphone

The server folder is located at /Library/WebServer/Documents/ in your root folder (that’s the folder with a hard disk for its icon). In order to share your music, videos and other stuff, you’ll need to create symbolic links to them and place them into this folder. Symbolic links differ from aliases created with Finder.

Leaving the server folder alone for the time being, open up your Music folder and delve down until you see the iTunes Music folder. Now, you need to create a symbolic link for this folder in order to share it. There are 3 ways of doing this.

stream itunes to iphone

The easiest way is to download and extract this droplet [Create Symbolic Link]. Drag and drop the iTunes Music folder into the droplet and it will produce a symbolic link for it with a .sym extension back to the same location. Take that link, drop it into the /Library/WebServer/Documents folder and remove the .sym from its name.

An alternative for that is to download SymbolicLinker. It adds a contextual menu that can easily create symbolic links by right-clicking on any folder. Mount the SymbolicLink DMG image file and drag the plugin into ~/Library/Contextual Menu Items/ then restart Finder by holding the Option key while right-clicking on the Finder dock icon. Then select ‘Relaunch’.

After Finder relaunches, right-click on the iTunes Music folder, scroll down to ‘More’ and select ‘Make Symbolic Link’. A new symbolic link appears with a “symlink” added to its name. Drag that link over to /Library/Webserver/Documents/ and remove “symlink” from its name.

If you’re a DIY-er, the Terminal method is the hardest and most complicated but I’ll show you how to do it anyway. Since you’re following these instructions instead of the above two, I’ll assume that you’re not a novice. That said, launch Terminal. Navigate to the server folder by typing:

cd /Library/WebServer/Documents

Then create a symbolic link to your iTunes Music Folder and name that folder Music

ln -s “/Volumes/[Your HD name]/Users/[Your short username]/Music/iTunes/iTunes Music” Music

Replace [Your HD name] with the name of your hard disk volume; and [Your short username] with your short username as seen in on the right side of the “Web Sharing” screenshot above, after the internal IP address but without the tilde. Check if the symbolic link has been created.

Now that you have the symbolic links, we need to make the iTunes Music folder web-accessible. Using Terminal, type:

sudo chmod 755 ~/Music

You’ll be asked to for your user password. Please note: You need to make the main folder of any sharing folder web-accessible or else, you’ll get an error. For example, in this instance, we’re sharing the iTunes Music folder within the iTunes folder which is in the Music folder. So, we make the ~/Music folder web-accessible. Now if you want to share a folder called “X” which is located in your Downloads folder, you need to make ~/Downloads/ web-accessible using the {sudo chmod} command. Since you’ve already made the ~/Downloads folder web-accessible, any other folder within this folder for which you decide to create a symbolic link in the future will be web-accessible automatically.

Okay, symbolic links – Check. Web-accessibility – Check. Let’s try it out.

In your browser, type in http://[Your internal IP address]/iTunes Music/ and you should be presented with a page containing a list of your artists.

That was just a taster. Now comes the sweet part – streaming movies to your iPhone! The movies can be stored anywhere as along as they are formatted in h.264. To be safe, I’ll just show you how to share your iTunes Movies folder. All videos stored in iTunes can be played on the iPhone or iPod Touch even if they’re not formatted for portability. Remember that .mov reference movies cannot be played.

If your movies aren’t formatted in h.264, iSquint is a great application for conversion. It was developed by TechSpansion (which has shut down) but iSquint is still available for free. Download it here and convert your files into iPod format to add into iTunes.

The iTunes movies folder is located within the iTunes Music folder, which means essentially it was already shared. Just scroll down the list of your artist until you see Movies. But to make it easier to call, we shall share the folder as well.

Create a symbolic link for ~/Music/iTunes/iTunes Music/Movies and place it in the server folder then rename it to Movies.

Test it out. In your browser, type http://[Your IP address]/Movies/

Great! Now whip out your iPhone, connect to your home Wi-Fi network and launch Safari. Enter your internal IP followed by /Movies/ like above. Click on any video, wait for it to buffer and it will start playing!

But what if you’re not connected to your local area network? You will still be able to access your music and movies from the internet if you allow port 80 to be forwarded to your Mac. There are a few variables here. For one, your internal IP needs to be static for your router to forward port 80 consistently to your Mac. Port forwarding varies depending on your router’s make and model, for instructions, go here. Second, even if your internal IP is static, your external IP may not be. If it isn’t, then you’ll need to sign up for DynDNS. If your external IP is static, then great – find out what your IP is by going to whatismyip.com then copy that IP and type it in your browser in this fashion:

http://[Your external IP address]/Movies/

You should be presented with the same list of files as when you entered your internal IP. If you received an error then check the variables: IP address, port forwarding, firewall.

Allowing access to port 80 on your Mac brings up security issues and unwanted intrusion. Be sure to have your firewall enabled and allow port 80 to come through. Also, be cautious when sharing your external IP address.

Like I said before, this is not a new tip. I merely wanted to simplify the process for Switchers and new iPhone/iPod Touch owners to follow. I hope you find this tip useful and you’re glad to finally stream videos to your iPhone.

(By) Jackson Chung is MakeUseOf's Assistant Editor and Mac Correspondent

Enjoyed the article? Subscribe to MakeUseOf to get daily updates on new cool websites and programs in your email for free. You'll also get free printable cheat sheets to your favorite programs

Your Email:

Add MakeUseOf to:



24 Comments Add Comment
2009-02-18 15:43:28
Sean

I don’t use a mac, but this seems like a great article. Always appreciate it when people make instructions simpler (even experts like simplicity).
I wonder if you can do this kind of thing on windows or linux, I’ll look into it.

2009-02-19 03:07:10
Jackson Chung

That’ll be great. Maybe you could post it back here if you find a way around it? Thanks

2009-05-07 15:33:29
Goose

SEAN Did you find a PC solution equivalent? Please post it I am looking for that type of solution.

2009-02-18 18:42:18
chady

Thanks for the info however it has not exactly been working for me.

When I try the symlink version of the folder it says I have a 403 error and that I do not have permission to view the folder.

Yet when I try it using the original folder it works perfectly, any ideas ?

2009-02-19 02:59:02
Jackson Chung

Yeah, I think you missed the step to make the folder web-accessible. Read the part above about using Terminal and the “sudo chmod” command.

2009-02-18 20:13:35

You listen to Andy McKee? I love you.

2009-02-19 03:04:27
Jackson Chung

Haha, I love you too but that’s sorta not the point, buddy :)

2009-03-20 10:35:48
aaron

Have you found any sort of media interface app that works with this? Rather than just viewing a web directory all of the time. It would be nice to shuffle/skip forward songs.

(Comments wont nest below this level)
2009-03-21 18:44:06
rai

kavatunes can stream your stuff using the technique above with itunes interface!

2009-04-05 17:23:38
Jason

when i go to watch movies or listen to music safari attempts to download the file
Thanks for the article

2009-05-05 03:42:47
Jackson

Sounds like you have a some kind of download plugin installed on your iPhone

2009-05-04 20:12:44
John

When I type “sudo chmod 755 ~/Music” in the terminal, I the warning “Warning: Improper use of the sudo command could lead to data loss or deletion of important system files. Please double-check your typing when using sudo. Type “man sudo” for more information.” Then I’m asked for my password. Am I OK to proceed with your instructions? Thank you for your help!

2009-05-05 03:42:05
Jackson

Sure it is. Just make sure that the command is exactly the same.

2009-06-23 20:53:21
Gary
Subscribed to comments via email

I have been using this method for a few months now. I recently upgraded to 3.0 software for the touch and now cannot stream video, or I should say any m4v files that are not in ipod format. In 2.2.1 software i could view it all, but now with 3.0 it will only do ipod format videos – any work arounds for this?

2009-07-16 13:14:54
Reaper
Subscribed to comments via email

Just wondering, how do you restore the original permission on the music folder, that you changed using the “sudo chmod” command?

ps I found this works great on iPhone 3G, v3.0

2009-10-27 09:50:48
Jackson Chung

I think a simple permission fix in Disk Utility will do the job.

2009-07-23 09:44:11
Chris B
Subscribed to comments via email

Thanks! Works great, both locally via home network, and thru the internet on my iTouch. I will probably make a web page to better navigate to my favorite music, but this is a great start.

One problem, I tried putting the symbolic link in my personal web folder (Users/myName/Sites/Music) but it didn’t work. Got “Forbidden” error, even tho I can get to Users/myName/Sites/index.html. Dragged it back to my Mac’s site and it worked.

Not a big issue, but just curious.

2009-07-30 11:29:17
erik

works beautifully thanks bro

2009-07-31 00:58:05
Minckster
Subscribed to comments via email

Instead of the possibly-changing IP address, you could use your MacBook’s Bonjour address:
http://jackson-chungs-macbook.local/

Its Bonjour address won’t change, unless you change it in Preferences. See the top of your second photo (Preferences > Sharing > Computer Name).

2009-10-24 01:05:05
Joseph
Subscribed to comments via email

Hello,

I want to say a big “Thank you” for taking the time and post these instruction for the rest of us. It is very detailed. YOu did a great job.

I was hoping I could be able to see my movies purchased at the itunes store the same way I can with the AppleTV. I imagine it has to be the famous DRM thing.

Why is it with apple that want to control our lives? If I paid for the movie and I can see it in the Apple TV, why is it they do not let stream it to other device like the iphone?

I just do not know if apple is a blessing or if it is a curse. Sometimes I just hate them.

It looks to me the only workaround is to use a DRM removal software, but imagine the task to convert every movie or song you want to see….

If somebody has any other ideas it would be welcome.

However, Great work and Thank you again Jackson Chong!!

2009-10-26 14:40:36
GN
Subscribed to comments via email

Hi, I was wondering if it’s possible to do the same with a NAS (network storage), so I don’t have to leave my Mac on all the time (+ I can store/stream even more files). Can I put those links on the root of the network HD?
I already configured the network so I can login to my network-HD from outside using a static ip-adress.

I sure hope it’s possible, thanks already

2009-10-26 15:49:37
Chris B
Subscribed to comments via email

That is what I am trying to do now–use NAS. I just got an Airport Extreme, but realized that I can’t serve my web media from the attached drive (or I haven’t figured out how). I can use it when running iTunes, but not via the web server. I don’t understand why the iPhone doesn’t have a Front Row-type interface for streaming iTunes media via WiFi–sort of like a mini AppleTV.

2009-10-27 09:56:16
Jackson Chung

I don’t think this is possible, guys. You need the web server to be running on your Mac in order to access it.

2009-10-29 19:00:53
Jamie

I have tried this numerous times but am still getting a permissions error despite executing the sudo chmod 755 ~/music terminal command. Trying to enable on a webserver running on 10.4.11 – an ideas what the issue might be? I’ve stop/started the server multiple times and also done this process from scratch 3 times. Looked for answers via Google but couldn’t come up with a solution. Seems like a very fundamental issue, but I can’t seem to find a straight-forward solution.

Reply

You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.