deadlocked » Stuff

By: Deadlocked  05/12/2011

deadlocked » Stuff

One of the great things about OS X Leopard is that it comes with Apache installed out of the box. Apache is an open source carrier grade web server that you can use to host websites and so on but more importantly – from the point of view of the iPhone or iPod Touch – it supports byte range reading. What this means is that your humble Mac can function as a streaming video server on your WLAN for your iPhone or iPod Touch with a little bit of legwork and a little PHP app that I threw together.

So how do you do it?

Next we need to enable PHP. Although it’s installed with Leopard, the PHP module is disabled in Apache’s configuration by default. Let’s enable it – open a Terminal and type:

sudo nano -w /etc/apache2/httpd.conf

(Note that the ‘-w’ is important – it disable line wrapping). Press CTRL-W and type php5 then press return – the cursor should jump to the line that loads the PHP module:

#LoadModule php5_module    libexec/apache2/libphp5.so

Delete the hash mark at the start of the line and then press CTRL-O to save the updated config, followed by CTRL-X to exit the Nano text editor. Back at the command prompt, we need to restart the Apache server:

sudo apachectl restart

Once you have some video, it’s time to test with your iPhone/Touch – connect your device to your WLAN and then open Safari and browse to http://yourdevice.local/~User/EasyStream/ (substitute ‘yourdevice’ for your Mac’s hostname and ‘User’ for the short form of your username). EasyStream should list the video in your EasyStream/Movies folder; tapping on one should cause QuickTime to open and after a short pause to buffer, your video should start playing.

Like most things, this trick has some pros and cons. First the pros – you no longer have to fill your iPhone/Touch up with videos; just stick them in your EasyStream folder instead. Secondly, if you forward port 80 on the outside of your firewall to your Mac’s IP, you can view your videos remotely provided you have a working internet connection for your device and know your public IP address (I’ve no idea how well this works over 3G). Finally, as our first test demonstrated, you can view the EasyStream pages in your ordinary browser – you can also view the videos (provided QuickTime is installed). The non-iPhone version of QuickTime downloads the entire video before it starts playing but you can fix that by ticking the ‘web optimised’ box in Handbrake before you start your conversion.

As far as cons go, I’ve built in a ‘compact view’ that breaks the videos into an alphabetical hierarchy but with lots of videos in your EasyStream/Movies folder, things could still become cumbersome. Secondly, there’s no way to bookmark where you are in a video, so if you stop playing something midway through and then go back, you’ll have to scrub through until you find where you where. Luckily the iPhone makes this relatively painless and it’s a worthwhile trade-off not to have to store the videos on your iPhone.


Contact Deadlocked

Email - none provided

Print this page

Share

Other products and services from Deadlocked

05/12/2011

deadlocked » Stuff - shite

Because of our proximity to Wales and especially Northern Ireland, we in the east and north of the country have been able to receive BBC broadcasts for decades despite not paying a license fee in that country. My attempts to circumvent their geo-location recognition mechanisms have always been fruitless until one day lest week when I was reading through the man page for SSH.


05/12/2011

deadlocked » Mac

I’m not sure if it’s a peculiarity of my file server – which runs Ubuntu with netatalk to share via AFP – but even though the server itself showed up in the network sidebar of the ‘Select Image to Restore From…’ file dialog, none of its shares did. My assumption was that I could go into Disk Utility, partition my new HDD and then restore the SparseBundle to it.


05/12/2011

deadlocked » Ubuntu/Linux

Ubuntu’s boot process stops and it displays a prompt directing the user to press ‘S’ to skip mounting or ‘M’ to manually fix whatever the problem was. I occasionally run into problems when Ubuntu reboots though – the partitions on the external drive can’t be mounted for whatever reason. I’ve a desktop PC that I’ve converted into a Ubuntu-based server by putting it in my utility room with no monitor connected to it.