Home Media Controller

From My Android Experiments
Jump to: navigation, search

How many of you have felt a need to have a remote control for your PC while watching late night movies and TV shows while lying in bed or a comfy sofa? Well I felt the need since a long time back. I like getting sleepy at night while watching a TV show or a movie on a LCD screen attached to my home PC / Laptop. But just the act of getting from bed to turn off the machine used to ruin my sleep, I would lay in bed for minutes trying to again feel sleepy. Well, so I decided to write an Android phone app that would enable me do just that and much more.


Features List

  • Browse videos on the remote PC/Mac/Linux Box
  • Browse audios on the remote PC/Mac/Linux Box
  • Start a video playback on the PC/Mac/Linux Box from your phone
  • Search for a video file in the media list
  • Add/remove remote audio files to/from your playlist
  • Play your playlist on the remote PC/Mac/Linux Box from your phone
  • Sleep/Hibernate/Shutdown your PC from your phone.
  • Start your remote machine using Wake-on-LAN signal (if your remote PC supports it)
  • Ability to save multiple remote PC/Mac/Linux Box details
  • Ability to easily switch between saved remote machines in the app

How to prepare your remote machine (PC/Mac/Linux Box) for this app

You will need to download a extremely small and light-weight java server program on your remote PC/Mac/Linux Box before you can make use of your phone app. The java server code is being released under GNU GLP license and you are free to browse through the server code. Feel free to enhance the code base to make it more feature rich, or point out any obscure bugs in the code.

  • Download the server program from this link: Home Media Server
  • Download and install VideoLANs VLC media player (if not already installed) on your remote PC/Mac/Linux Box. You can get VLC media player from this link: VideoLan VLC Player
  • Put all the video files you need your phone app to discover for playback control under the standard OS video folder. For Windows, this folder is typically called My Videos or simply Videos and can be easily accessed under your user's home folder. For Linux, this folder is typically at ~/Videos
  • Put all the audio files you need your phone app to discover for playback control under the standard OS audio folder. For Windows, this folder is typically called My Music or simply Music and can be easily accessed under your user's home folder. For Linux, this folder is typically at ~/Music
    • Because of a small bug, media files and folders containing spaces can not be remotely played under Linux environment through this android app, so under Linux kindly take care in how your media files and folders are named. A fix will be released very soon.
  • Any number and levels of subfolders are OK and allowed under the Video and Music folders.
  • Your remote machine must have a supported Java runtime installed, JRE 6.0 and higher is required. You can choose between OpenJDK or Oracle's Java Runtime Environment. If not already installed, get the JRE from this link Oracle JRE, or by following the steps outlined here: OpenJDK
  • Extract the contents of Home Media Server zip file to a location of your choice.

Executing Home Media Server

Go to the folder where you extracted the contents of the zip file. If you are running Windows, you can start the server with default parameters by just double clicking on the included batch (.bat) file. For other OS environment it is best to start the server program using a terminal / shell / command-line.

The server program uses these defaults for the location of the VLC player executible file:

  • Windows: C:\Program Files (x86)\VideoLAN\VLC\
  • Linux: /usr/bin/

If your VLC media player executible file is located at some other location than the assumed default location please start the HomeMediaServer using a terminal / shell / command prompt and provide the folder path of the VideoLAN media player's executible as a command line argument to the program.

IMP: remember the path is the path of the folder where the executible resides and NOT the full path of the VLC executible itself.

Open a terminal shell program or a Command Prompt (if using Windows) and change directory to the folder where you extracted the HomeMediaServer.zip contents.

usage: java -jar HomeMediaServer.jar [-f <arg>] [-h] [-p <arg>]
Home Media Server by Piyush Harsh
   -f,--vlc-path <arg>     path to the vlc media player
   -h,--help               usage help
   -p,--port <arg>         port to start the server

Use the proper switch and arguments while starting the java server program from your terminal program. The VideoLAN's media player folder argument must be included withing double-quotes ("..."). Once the program starts, it will display something as shown below:

Starting the Home Media Server ...
Querying local interfaces for candidate IP addresses. Please wait ...
Host OS Detection: linux; User Home Folder: /home/user123/; Using default VLC path: /usr/bin/
Server is reachable at ({ip:mac}*|{ip:mac}*): AA 0C 12 11 12| at port 54321.

Built local videos cache. Files processed: 11
Built local songs cache. Files processed: 121

The IP and MAC addresses have been changed in the example above to maintain privacy. The program will output both real and virtual NIC details, the virtual list (if any) will appear after the (|) pipe character. In the example above, the remote machine has no virtual interface setup and therefore the virtual interface list is empty.

IMP Ignore the virtual interface list if present. Use the IP of a real interface only to configure and save the remote machine in your android phone app.

Home Media Controller Android app

You can download the app from the Google Play Store.

Shown below are few screenshots of the Home Media Controller app that you can download from the Google Play Store from your android phone.


Screen Shot 1
Screen Shot 2
Screen Shot 3
Screen Shot 4
Screen Shot 5
Screen Shot 6
Screen Shot 7
Screen Shot 8
Screen Shot 9
Screen Shot 10
Screen Shot 11
Screen Shot 12


Home Media Server program is running and you have installed the app on your phone and configured your remote PC/Mac/Linux Box in your app, still you can not browse the media list and control the playback from your phone? Do not worry ...

Is your phone Wi-Fi turned on?

Make sure your phone wi-fi is turned on before you try to browse the remote machine's media files.

Still can not communicate?

Try disabling your remote PC's firewall, it may be blocking the app's connection to your remote PC.

Personal tools