Send Command to XBMC to Start Music
Written by Josh Lyon   
Saturday, 20 February 2010 22:59

You can use the following command to remotely start music playing on XBMC. The examples below were sent while I was SSH'ed into the XBMC machine. As you'll notice from the music paths, I am using some of the 'special' paths which call up the LastFM tags of Rap and Alternative.

Start the LastFM Rap tag playing:
xbmc-send -a "PlayMedia(lastfm://globaltags/rap)"
Start the LastFM Alternative tag playing:
xbmc-send -a "PlayMedia(lastfm://globaltags/alternative)"

To play a tag that contains a space in it's name, you must URL encode the space in your request (eg. replace all the spaces with %20). For example:

Start the LastFM 'Classic Rock' tag playing:

xbmc-send -a "PlayMedia(lastfm://globaltags/classic%20rock)"

I should note that each LastFM request is mutually exclusive of the other. Meaning each time you send a new PlayMedia request, the old genre/tag will stop playing and the new one will start playing.

I'll add to this later when I start documenting some of the various URLs and functions that can be used to start playing music. A list of functions that can be sent can be found on the XBMC wiki.

Pre-Requisites

In order to use the above commands, you must be on a machine that has network access to the XBMC machine and you must have remote commands enabled in your XBMC settings. The alternative method of sending these commands remotely is to do as I do and SSH into the XBMC machine remotely, then send the commands locally.

Also, you must have the XBMC-Send client installed on the machine that is sending the request. To do this with aptitude (on Ubuntu / XBMC-Live), use the following commands:

Update the Aptitude local repository:

sudo apt-get update

Enter the password for the super user if prompted (the default is 'xbmc').

Install the xbmc-send client:

sudo aptitude install xbmc-eventclients-xbmc-send

Enter the password for the super user if prompted (the default is 'xbmc').

Press Y to continue when prompted.

(Optional) Test out a command:

xbmc-send -a "Notification(Testing,XBMC Command Success.)"

You should see a quick notification box popup on your XBMC installation as soon as you press enter on the above command.

Comments (2)

Love this BLog
0
I only discovered this blog a few days ago and I love all the XBMC stuff. The command line stuff is brilliant. Definitely gonna have a good look around!
Thankssmilies/smiley.gif
Stephen , June 06, 2011
...
0
Welcome to the website of N1 best, we are the number one wholesale dropshippers in the UK . We supply to the Trade. We import and distribute wholesale products. We have been established for three years now, and in this period of time have become one of the most reputable wholesale dropshippers in the sector. With being directly partnered with the leading manufacturers for digital and electronical items means that all of our drop shipping products are of the highest quality.
http://www.n1best.com/

somon , May 17, 2012 | url

Write comment

smaller | bigger
security image
Write the displayed characters

busy