leica
12-19-2010, 04:27 AM
Here's a project I started a month or so ago and forgot about: creating a HTPC operating system with a remote Web UI from scratch. Tonight, I finished it.
My old Dell desktop runs Arch Linux and includes an Apache HTTP server with PHP. Originally, it ran Xfce and I had to VNC in to select something to watch. Now, I have xine, a media player, starting instead of the desktop environment. xine includes this cool thing where it can listen for remote connections to control playback. This lets you control it by command line, by script, or in this case, by Web interface.
http://25.media.tumblr.com/tumblr_ldo7bxPODU1qf6wp3o1_r1_500.png
(click to view larger) (http://i.imgur.com/SFypg.png)
When the Web UI is accessed, PHP recurses through the video folder to list available files. A custom sort function is used to allow for different filename formats while keeping episodes in order, as you can see in the screenshot.
When a filename is clicked, PHP tells xine to load and play that video. The play, pause, and stop buttons also do what you’d assume they do. The ‘hide gui’ link allows you to hide xine’s control window if it appears for some reason.
After I add video queuing and some security fixes I'll give out the source code. :)
My old Dell desktop runs Arch Linux and includes an Apache HTTP server with PHP. Originally, it ran Xfce and I had to VNC in to select something to watch. Now, I have xine, a media player, starting instead of the desktop environment. xine includes this cool thing where it can listen for remote connections to control playback. This lets you control it by command line, by script, or in this case, by Web interface.
http://25.media.tumblr.com/tumblr_ldo7bxPODU1qf6wp3o1_r1_500.png
(click to view larger) (http://i.imgur.com/SFypg.png)
When the Web UI is accessed, PHP recurses through the video folder to list available files. A custom sort function is used to allow for different filename formats while keeping episodes in order, as you can see in the screenshot.
When a filename is clicked, PHP tells xine to load and play that video. The play, pause, and stop buttons also do what you’d assume they do. The ‘hide gui’ link allows you to hide xine’s control window if it appears for some reason.
After I add video queuing and some security fixes I'll give out the source code. :)