|
|
#1 |
|
Junior Member
Join Date: May 2011
Posts: 9
|
How to use the AJAX API?
I'm wanting to create a basic page where i can control/manage certain aspects of shoutcast while away form the broadcasting pc.
Reading the AJAX API documentation it appears as though what i want can be done via that but am unsure how its supposed to be done. I've had a look at the testui folder but nothing in it works correctly Can anyone give an example of how i would call the APIs from a web page please Thanks |
|
|
|
|
|
#2 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,244
|
the only example currently is what is in the docs and via the testui code (unless you can find some other posts).
what isn't working correctly for you? (ignoring that it's not cross-site compliant - related to sc_trans, doesn't work in IE and is slowly being re-implemented as time between all other SC projects allow ).and you are aware that this only affects the Transcoder and wouldn't be related to the DNAS server's handling of the broadcast, etc. -daz |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: May 2011
Posts: 9
|
I basically want to be able to do things like reload the transcoder, skip to the next track. Etc.
When trying to use testui I get the index page, enter the server details, it loads the admin page but nothing on it works. Links don't load |
|
|
|
|
|
#4 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,244
|
browser? on the same machine? OS you're trying to use it on?
but pretty much as i gave a big hint in my reply, testui doesn't really work apart from on some configurations (mainly Windows + Firefox + local machine is known to work). but it should be enough to look at to see how the apis are used and you can then make something which will work (or wait for a working version on other browsers / remote installs - but that has no eta). -daz |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: May 2011
Posts: 9
|
I've tried it on both firefox and ie. I get the problem I said earlier on ie and firefox doesn't load it at all. I've tried it locally on win 7 and xp.
|
|
|
|
|
|
#6 |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,244
|
i dunno then why it's not working as it should be ok in Firefox - only thing would be to try using Firebug or something like that to see what's going on or not as seems to be the case.
but as is mentioned in the docs, testui doesn't have any true support and won't be until it's re-done. -daz |
|
|
|
|
|
#7 |
|
Major Dude
Join Date: Jun 2007
Location: NSW Australia
Posts: 1,655
|
You will always have "cross domain" issues trying to use pure AJAX
using an intermediate server with PHP (or similar) is one solution - but you need to write the PHP code to act as a go between, the code is simply acts as a sort of "proxy" between the browser and sc_trans the simplest solution would be if the coders responsible simply add a CORS header to the response headers - I've made the suggestion at least twice, no response suggests it will or wont happen another solution is to use flash (even just as sort of proxy as well) - I believe sc_trans can be setup with a socket policy server General Shoutcast troubleshooting guide
|
|
|
|
|
|
#8 | |
|
-
Join Date: Sep 2003
Location: UK
Posts: 22,244
|
Quote:
-daz |
|
|
|
|
|
|
#9 |
|
Major Dude
Join Date: Jun 2007
Location: NSW Australia
Posts: 1,655
|
Dude ... chill ... I know someone said they'd "look at CORS", but I realise there's probably a gazillion more important issues to be fixing in sc_trans than API stuff ... I found the PHP "proxy" to be a workable solution for me anyway
General Shoutcast troubleshooting guide
|
|
|
|
|
|
#10 |
|
Junior Member
Join Date: May 2011
Posts: 9
|
I'm pretty confident with php but can't work out how I'd do it
|
|
|
|
|
|
#11 |
|
Forum King
Join Date: Feb 2006
Location: Earth Circa sometime.
Posts: 3,297
|
I get the api to work if the html files are local on the hard drive not a web server, but I don't want somene using the api via the web I have see it race sc_trans to 100% more than once.
what aspect of control do you need? I did my automation using IRC bots and cli (command line) to skip, reload, rotate, load playlists, kick DJ, and so on . Not one API call , heh. ~ According to the ship's log we're down to our last 3000 vomit bags.It'll never be enough. ![]() search the forums! don't PM me on how-to, or ask me to setup you system. you do it so you learn. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|