GeekShadow
Can you made an option to allow access to the network and not only local ?
I know it's "server._socket.init(server.port, false, -1);" You just need to put an option :)
Control songbird playback via HTTP (localhost only)
It's not the best idea, but until songbird on OSX works properly with command line arguments, it's the only way of controlling songbird from the command line (and, therefore, with global hotkeys).
Usage:
command line
The easiest thing is to use the included script. On my system, it lives at
~/Library/Application Support/Songbird2/Profiles/xxxxxxx.default/extensions/get-control@gfxmonk.net/songbird-ctl
I suggest making a symlink somewhere on your $PATH, and then you can hook it up to be run for whatever hotkeys you like
web interface
The web control page is part of the github project (it's in the web-control folder). Boosh wrote the original version, and I've modified it to include some information about the current track.
You'll need to run it from an actual web server (with PHP), and if that's a different computer than the one songbird is running on you'll need to modify the included php script (and set the songbird preference extensions.GET-control.localonly to false).
If you want to do things manually:
load http://localhost:50136/ctl/ACTION with your preferred HTTP client
- where ACTION is one of: play, pause, playpause, next, prev, stop, mute, volumeup, volumedown
You can specify the port to use in the preference "extensions.GET-control.port" (requires restart to take effect) If you want to allow any computer on your network to control songbird, set "extensions.GET-control.localonly" to false
The source is on github: http://github.com/gfxmonk/songbird-get-control
Added status information (about the currently playing track).
Added a web interface (created by boosh, with modifications by jhlassen17 and now myself) - it's not part of the extension itself, you can get it from the github project
Can you made an option to allow access to the network and not only local ?
I know it's "server._socket.init(server.port, false, -1);" You just need to put an option :)
Tell me how I can help, You can add me to the github project ;)
Just what I wanted! thanks!
^^ and allowing access via a network would be perfect ;-)
@gfxmonk
Sweet :)
@gfxmonk
Ok I try things to get my changes commit with GIT, but I don't find how to do that. I find SVN more easy :D
So I have a pretty good solution I will post patchs here (and I wait for you to put the project on a SVN :p)
Patch 1 : http://geekshadow.com/fichiers/patch1_getcontrol.zip
modified files : install.rdf, server.js
Add : volumeup, volumedown, mute, stop
@gfxmonk
Thanks, I know you wont move to svn since you already have many projects on github, I was joking ;) Still I need to learn more about git, thanks for the link !
Thanks for the update gfxmonk/geekshadow!!
Networked control via the web?! My dreams have come true. Thanks gfxmonk now i can die happy :D
hey again, I'm trying to get it to work over the network via a webpage:
http://web.mst.edu/~mjppw9/songbird-control/
But right now it only works on the local computer and not over the network (I have extensions.GET-control.localonly set to false).. Do I have to use the script located in the extension directory directly and not use the http://localhost:50136/ctl/ACTION command. Or Is one of my computers just being stupid... Any help/direction would be greatly appreciated ;-)
Ha Ya, I was laying in bed and uttered "localhost... oooooh... theres the problem.." rookie mistake! Completely overlooked localhost - I'm using my computers network name now... :-) .. Using the ip address didn't work for some reason, but the computer's network name did! Swweet! Thanks!
@boosh
Nice interface !
Can you made it available to other people ? (Zip it and have gfxmonk to put it in description)
@boosh
great ! I test it on Fennec : no problem, and Android browser : You can only clic once on a button, you need reload the page to get the button working again.
Also it may be better to move the script in PHP to have only one var for computer url.
@GeekShadow
Ya right now the links are opening in a hidden iframe, so if you know how to do it more efficiently using PHP that would be awesome!
errr... I found a way to avoid the scripts i'm using... i'll update it soon, and you can test it..
ok try this on in android: http://wiki.songbirdnest.com/@api/deki/files/1085/=songbird-control.zip
should be all-browser friendly now, hopefully...
Is it possible to poll information from SongBird? Like if I wanted to glance and see what was playing, or would that be beyond the scope of this addon? I would be willing to help code it, what do you guys think?
To explain more, I am definitely using this on my phone to control Songbird from anywhere in the house. I think it would be cool to see what was playing from my phone, but I know that would require a bunch of code, and I don't know if other people use it that way. I think this is a great addon as it is, thanks for putting it together.
@boosh: Hey, if it is okay with you, I edited your UI to use AJAX. I made two versions, one for local use and one for remote use. They are pretty much the same.
The remote one uses PHP to post the GET request, which bypasses the AJAX domain restrictions. Let me know if this is helpful. File Here.
Thanks.
@jhlassen17: Ya, no problem! What's mine is yours ;-) They're awesome (I linked to them on the wiki page)
I was also bored and created an iGoogle gadget for people that lack a web site...
http://www.google.com/ig/directory?url=songbird-remote.googlecode.com/svn/trunk/songbirdcontrol.xml
Yeah, that's fine with me.
excellent add-on... only way i could get global hotkeys working on Mac OS w/ Quicksilver (the other command line addon wouldnt work in Mac OS). I can see how this could also be useful for remote control.
This is an excellent add-on, I have now made an Google Chrome extension based on it and boosh's webpage control using XMLHttpRequest, downloadable here.
Well, I wanted to check wheter the current song was playing by using the JSON answer to set the play/pause button correctly, but as it seems there is no answer I could get the information from, any ideas?
You can get the code here or as zip.
You are right, I knew this before and was also using the latest version, I've also tried to connect with a simlpe Java application I want to use to implement a system-wide now playing key shortcut, however with Java it works perfectly but the JavaScript XMLHttpRequest object doesn't return any text at all, the responseText is empty and the responseBody is undefined after my send() call.
See the source of my toolstrip here, maybe you can tell me what I'm doing wrong?
I see I confused you a bit, what I meant was:
In my Chrome extension, I want to use a XMLHttpRequest to retrieve the status and/or send the clicked commands. I have allowed the access to any hosts via HTTP in the config file of the extension.
However it doesn't work like I wish, get control would take the command and execute it but there is no response data when onreadystatechanged is called and readyState is 4.
I also wrote a little Java application that sent the status command and I could receive an answer with it.
If I understand correctly all this php file does is taking requests on port 80 and forwarding them to the GET command port, right? I would have to set up an web server on port 80 to use this php file, right?
I have tried numerous ways now to get this working, but no one seems to be able to break through the security walls...
An XMLHttpRequest would get as far as sending a request and maybe even getting a response, but if cross-orgin is the case, then the response will not be readable, that's e.g. the concept of some does-that-host-exist-check script, it opens the pages using a XHR too, but doesn't use the contents.
What I've tried too was using a Java applet and direct Socket calls, but that failed too because applets aren't allowed to cross-orgin-request data either.
When I tried to use your remote too, but shouldn't it output something about the track? For me, it didn't output anything...
Of course I've tried to use the php relay too, but unfortunately I couldn't get that WAMP server running so that it would process the curl calls...
Well, I've got to go to school tomorrow, so maybe it's better if I stop wondering about it for now, good night from Austria.
Please, please... update for 1.4.3...
GeekShadow
Awesome !!!
Thanks a lot for this addon :)