How-To: Control iTunes from any web browser
For today's how-to we're going to set up a simple web server in XP so that we can control iTunes remotely. Engadget reader Jordan Parker was tired of having to walk into the other room to change tracks so he put together the PHP script we'll be using. The page it generates should be usable on any device with a web browser. Similar solutions exist for OS X. Click on to get the full skinny — it's worth your time, promise!
The first thing you need to do is download this zip file
containing the PHP and image files. Unzip it in a directory you can find later.
Next you’ll need to install a web server. We’re using BRS WebWeaver since it is really lightweight, approximately
375KB. Download
BRS WebWeaver here. The install is straightforward and you won’t need to change any of the defaults.
PHP is the next piece that needs to be added. Download the PHP 5.1.1 installer. The installer will ask you which HTTP server you would like to configure. Since BRS WebWeaver isn’t on the list select “None”. We will configure it manually.
After the PHP install has completed, start BRS WebWeaver.
Select “Options > Server Config”. Click on “HTTP Server” in the tree. Use the button next to the “Virtual Root” text box to select the directory that you unzipped the PHP files to.
Now click on the + sign next to “HTTP Server” to expand the tree. Select “PHP” in the tree. Click the check box for “Enable PHP Processing”. For “Location of PHP.EXE” you need to navigate to the folder where PHP is installed. If you chose all of the defaults it will be located at “c:\php\php-cgi.exe”. Click “Save”.
Now click on “File > Start HTTP Server”. XP should generate a firewall warning since the web server is opening a port. Click “Unblock”.
Now the server is completely set up and ready to test out. First, open iTunes and start a song playing. Then, open a browser window and navigate to the front-end. Since you are on the same computer as iTunes, go to “http://localhost/player.php”. You should see an interface identical to the one at the top of this post. If it works move to a different computer on your network and try the test again, this time replacing “localhost” with the actual IP of the computer hosting iTunes (or it’s NetBIOS or DNS name, if you want to get fancy).
We’d like to thank Jordan Parker for his fine work. He said he thinks he’s not the best PHP programmer and is interested in seeing what improvements and modifications others will make to his code, but we think he done good.
















Link to the ZIP doesn't work.
maybe its just me, but the "download this file" link doesnt exist? it says it's http:///
Pretty handy stuff. I live in a dorm and my room is right next to the lounge. I controlled my iMac iTunes with my iBook when I threw a party in the lounge. Even on the Windows end this is pretty nifty.
Am I the only one who operates iTunes and the iPod almost exclusively through the "browse" (by artist and then by album) feature? Without a browse, I'm sorry, but it's no good for me. That's why the Playlists menu on the iPod is useless for me as well -- It's just a list of songs with no artist or album information.
I'm guessing I must be the exception, or I would have heard other people complaining already (not in this thread but elsewhere).
@4 same with me, I am also using the browse function and who cares about playlists ;)
Network control of iTunes has long been available via Applescript on Mac's since day one. It's extremely easy to set up. For all you mac users, check out http://www.dougscripts.com for tons of scripts including network control.
I have a similar solution for Mac OS X using perl and applescript. The problem with doing this on the Mac is that most sites found through Google recommend running apache as the console user, which is a potential security risk. My method is similar to Jordan's in that I have a slim web server running under my account with no privledges other than running the predefined commands to control iTunes (or anything else, for that matter) through AppleScript.
I have a brief write up of the program at my personal project site: http://projects.newrisedesigns.com/
I'm at work now, but I can post the perl and applescript code once I get home.
John
oh boy, here you go again egadget hawking another apple related product. showing once again your apple bias - what is this, c|net? jump on in apple fanboys and enjoy it while you can, because soon the zen vision:M will come out and expose you all for the idiot lemmings you are. suckers.
is overratediPod's post supposed to be ironic? i'm confused. i guess being a zen lemming is better than being an ipod lemming, the zen lemmings jump off a waterfall cliff instead of those ipod water-less ones.
Link to the ZIP doesn't work. :(
I think overratediPod was being sarcastic or ironic, because there's no way you can have a gadget/technology weblog that claims to provide any kind of comprehensive coverage without ever *mentioning* an Apple product.
This is cool, thanks engadget.
NICE. Finally someone with a brain. Awsome.
Ooh i can hardly wait for the zen vision:M
That was ironic by the way
Is there anyway for this to work on a psp on its web browser???
Why not just install itunes on the other machines on the network.? I am not sure I see the benefit..
I use Remote Administrator(radmin.com) to run my main computer from my laptop in the next room. That way I don't need a special script for every single application I want to control remotely. The server side uses up at most about 10 percent of the cpu.
Logan,
mentioned previously on Engadget:
http://www.coverbuddy.com/
#15, because the computer most conveniently close to you might not be the same as the computer hooked up directly to your sweet-ass stereo system. Also, that nearby computer might be a laptop that you just want to open up, select a song, and then close up and put back to sleep (at which point of course it can no longer play music). So it does have some value, I think.
And also, I see no reason why it wouldn't work on a PSP browser. That's a pretty sweet use for this (aside from the lack of Browse capability I discussed earlier).
overratediPod enjoys jacking comment threads:
http://portableaudio.engadget.com/entry/1234000460072252/#comments
I'm not really sure how fixing product shortcomings makes us Apple shills.
Dave and overratediPod have the same IP address so something more sinister/obnoxious is going on here.
Sweet!!!!. Apple has always been better than MS-fact,
And something that's infinitely easier to set up for winamp: ml_www. http://sourceforge.net/projects/mlwww/
Not only can you control your music from the web, you can also download/stream it! Looks like it hasn't been updated in a while, but it works.
This only works for local computers?
not from my treo?
a long time ago I was experimenting with ajax, and wrote a php ajax script that used xml-rpc to connect to a little python script on another machine which controlled itunes through COM...I already had a linux web server and a windows machine with itunes, so I connected them. It was pretty ghetto but it was nicer to use than this (no refreshing cause of ajax). I think i threw it away though.
Anyone got this working with Apache yet? I already have it running on my machine but I get
Warning: (null)(): Unable to obtain IDispatch interface for CLSID {DC0C2640-1415-4644-875C-6F4D769839BA}: Server execution failed in c:all workwebitunesplayer.php on line 2
Fatal error: Maximum execution time of 30 seconds exceeded in c:all workwebitunesplayer.php on line 2
...when I try to use it. Ideas?
i keep getting a page that says "404 error the requested url is not available on this server"
Apache kind of seems like overkill just to control iTunes. I found it far simpler to just write a python script to run a small webserver in order to control iTunes + anything else, as it seems other people on here have found as well.
i keep getting a page that says "404 error the requested url is not available on this server"
Add my thanks to the list, Lords of Acid via remote control? Oh hell yeah!
If you have Firefox as your web browser you can controll just about any music program including iTunes. The program you need to download is called FoxyTunes. You can get it at www.foxytunes.com. I just love it! You can even download some skins for it!
If only windows has a built in server! =P
"Why not just install itunes on the other machines on the network.? I am not sure I see the benefit.." Exactly. iTunes will let you share your music library, you can even password protect it. This is the most useless gimic I've ever seen on Engadet -- don't praise people for remaking things that software already does. The only advantage I see to this is that it will let you manage iTunes from a computer on a different wireless network... Um, guessing that most people aren't going to want to do that.
Am I wrong here, is it just stop/foward/back functionality?
And you need to physically start the first mp3 at your machine?
Seems limited :(
This is just what I've been looking for. My Media Center PC is connected to my stereo system. Until now I've had to use Windows Media Player which I can control remotely with Niveus PocketPC Remote. Now I can use iTunes and control it from other PCs in my house.
Here are some links that instruct on how to setup access in iTunes of remote libraries over the internet. I've done this to access my home library while I'm at work. My home computer is a mac and my work computer is a Win XP machine.
Mac: http://www.codewitch.org/archives/2005/04/sharing_itunes.html
Windows: http://www.sevitz.com/blog/2005/03/how_to_share_your_music_via_itunes_on_the_net.asp
To all the people asking if this works with the PSP web browser, then yes, it does. Just make sure you change the cache option to 'Do Not Use', otherwise after you have pressed a button once it won't work anymore as the PSP is just reloading the page from it's cache.
16, 30 & 31 - wow are you shortsighted, no, make that dumb - do you always post comments about how useless something is just because you can't fathom the use case? Or can't see why the use case isn't 'all about you'?
This use case is where the sound system is hooked to another computer at some distance (not necessarily same OS or has iTunes share capability with the machine you are sitting at.) Nice to change tunes/netradio from across the office without interupting one's work. Assuming one is old enough/competent enough to be gainfully employed. At my last office we had a older machine dedicated to the voicemail system, the sound system for everyone and some other general office functions. No one sat at that machine. The remote control I had in place was good to combat the marketing chicas always dialing-in lame-o 80's music.
Kudos to engadet for making an effort, unlike the pathetic whiners who criticize every little thing. And yes I am criticizing the whiners --please blow it out your, ya well, perhaps a bulb will flicker and you can figure out the rest.
16, 30 & 31 - wow are you shortsighted, no, make that dumb - do you always post comments about how useless something is just because you can't fathom the use case? Or can't see why the use case isn't 'all about you'?
This use case is where the sound system is hooked to another computer at some distance (not necessarily same OS or has iTunes share capability with the machine you are sitting at.) Nice to change tunes/netradio from across the office without interupting one's work. Assuming one is old enough/competent enough to be gainfully employed. At my last office we had a older machine dedicated to the voicemail system, the sound system for everyone and some other general office functions. No one sat at that machine. The remote control I had in place was good to combat the marketing chicas always dialing-in lame-o 80's music.
Kudos to engadet for making an effort, unlike the pathetic whiners who criticize every little thing. And yes I am criticizing the whiners --please blow it out your, ya well, perhaps a bulb will flicker and you can figure out the rest.
I can't seem to get this to work. I'm running PHP 5.11 on top of Apache 2.2. It's not WebWeaver, but my other PHP apps work fine. The problem seems to be in instantiating the COM object. Anyone else had any luck?
TO APACHE USERS - Unfortunately, there's some strange problem with apache and PHP permissions (ie. php not being able to create COM objects). I found a tutorial online for how to fix this, but it didn't work. I think if you re-install PHP as the .exe file instead of the apache plugin, it might work.
Hiptrigger,
First off, you seem pretty smart there with the double post.
I've read about other solutions that have far greater functionality, so skipping ahead one song is very limited.
I'm setting up a touchscreen device and would like it control itunes on another pc, not just skip one song at a time. Any other solutions out there, like coverbuddy?
Guys,
Apple has exposed pretty much every functionality you could want to control in iTunes through the iTunes COM SDK (http://developer.apple.com/sdk/itunescomsdk.html). It's just a matter of putting in the time to develop the application that actually makes use of all of it. My problem right now is that I can't get PHP to even instantiate the COM object.
Pretty cool. It's a little flaky in the browser on my WiFi enabled PPC, but if I can get it working better it will make a nice remote!
All this setup time just to control iTunes. I suggest getting Firefox!!!! Then download the FoxyTunes Extention, and you are ready to go!!! It is much easier than installing web server capabilities to your computer!
tried installing this with apachefrieds lite, and no dice. Apache works, php is configured, but i get the pretty itunes looking remote with this:
Fatal error: Call to a member function Name() on a non-object in C:apachefriendsxampplitehtdocsitunesplayer.php on line 47
anyone get this working with any web server??
Alejandro: Foxytunes will not let you control iTunes from another room! I doubt anyone is setting all this up just to control iTunes on the one PC.
SWEET! It does work from the psp! It works perfectly! I can't wait to screw around with my dad when he's trying to listen to music on the comp!
SWEET! It does work from the psp! It works perfectly! I can't wait to screw around with my dad when he's trying to listen to music on the comp!
if you replace "localhost" in the url with your IP address (assuming you're not behind a router) it will work using any internet connection. I've had some friends test it, and they have been able to control my iTunes from their computers.
I see this having tremendous prank implications.
Does anyone know anything about streaming music, radio-style, from iTunes? That would be great.
OR! you could download Tuneconnect. Until this is a standard iTunes feature, it's IMHO the most desirable alternative. copy and paste
http://www.apple.com/downloads/macosx/ipod_itunes/tuneconnect.html
Hey it asks me for username and password. Can anyone help
"Here are some links that instruct on how to setup access in iTunes of remote libraries over the internet. I've done this to access my home library while I'm at work. My home computer is a mac and my work computer is a Win XP machine."
Couldn't you just set up a VPN if you wanted to share using iTunes on Windows XP? Since there is a built in VPN server.
What I would like is to keep iTunes in a single account only, my brother installed it and now every time I press the MEDIA button in my keyboard iTunes comes up instead of my wanted Windows Media Player. Also a new service starts in my session and I honestly am starting to hate this program as also a link appeared on my desktop and in my Start-Programs.
I know that these can be tweaked but that's not the point, the point is that it shouldnt expand to AllUsers
I just run VNC server on my Windows PC running iTunes, and I can log in from any PC on the newtwork: Windows, Linux, or Mac OS. It's useful for more than iTunes, too.
okay little help here. I looked up my PC's IP address and in my PSP I typed "http://myip/player.php" and I am getting a password prompt. Is there something I am doing wrong?
Another solution to control ITunes from another room... Remote Desktop to the PC next to the stereo. In the Local Resources tab, leave the sound at the remote computer. Control away
The Mac solution referenced in the article is how I do it between multiple Macs around the house. The iMac in the office has the iTunes library. It plays through the stereo in the lounge via an AirportExpress. There's also speakers in the kitchen and office linked to the stereo. The kitchen has an SE/30 and an old web browser pointing at my iMac's webserver which has a modified version of the php script so I can change tracks when sat in the kitchen. The SE/30 of course can't run iTunes.
The SE/30 also controls a number of kitchen appliances (like switching on the kettle from my office iMac via some more applescript) via X10 and acts as a fax/voicemail server. Handy little thing.
Is it me, or a better solution is simply to control the other pc by using a vpn or VNC? They're also free and very simple to set up. That way you have control of not just iTunes but the entire computer.
Tx
This is pretty cool but if you have the extra cash, go out and get a Sonos system.
I'd like to see someone come up with a solution similar to the PHP script, but as a full-featured Ajax setup. I'd love to do it, but I have very limited Javascript/HTML/Etc experience, as a student so far I've mostly had C...
anybody know how to get it to work if the computer that has itunes is on a wireless router?
laaaaame. Are you people that lazy that you can't walk over to a different terminal to change songs? jeez. What are you doing on the remote computer that is so important that you can't get up for less than 2 minutes? Yes, I can see the use for it, but that doesn't take away from the laziness factor. It doesn't take too long to figure out why the obesity levels are so obscene...
Flame away, I care not. I am not a troll, I'm making a point.
Sure man! Yeah you can get up of that chair once or twice, but it starts getting pretty old when you have to do it over and over.
VCN Period - end of story....
I have a router and keep getting the 404 error, can someone please help!!!!
ive made a version veiwable on cellphones. u can veiw it at www.cycodude.com:81. also ive seen some ppl have tryed to use xampp, but ive tryed to and it will not work cause it doesnt use php version 5.1.1 that will let you use com controlls. also the beta of xampp that uses php 5.1.1 will not work cause it disables com controlls.
dpsleep / cycodude
Looks nice, will probably work better with my PPC than the original.
How about making the source available.
For those having trouble getting the original to work:
Unable to open COM - my fix for this was to replace the Quicktime alternative player with the proper Apple one.
Timeout on php script - move the php.ini file to the same dir as php-cgi, enable dcom & extend the timeout parameter (not sure which was the problem)
How did you get the volume up and down?
I have redone all the grafics to itunes v.6
I have added a basic library feature which extracts data from iTunes and displays a list of tracks which can be played. The track listing can be filtered by genre. Download the new version. http://www.pjdaniel.org.uk/webtunes/
I've built a standalone webserver for windows that requires no additional software to be installed. I call it rTunes and you can get it from the link above. My UI isn't as pretty, but it is totally open for modification.
since the link for downloading the php scrips doesnt work i looked in that jordan guys blog http://www.badongo.com/file.php?file=iTunes%20PHP%20Script__2005-12-01_itunesPHP.zip
there it is
The easiest way to do this as well as allow people to download your tracks from a remote location is with DOT-TUNES for Mac & Windows.
http://www.dottunes.net
It comes with Client, Server and Tracker applications which allow you to share your tracks, connect to other servers and the Tracker is like a Directory of Servers from around the world where you can connect and download music from within someone elses iTunes Library.