Go Back   Winamp Forums > SHOUTcast > SHOUTcast Discussions

Reply
Thread Tools Search this Thread Display Modes
Old 19th May 2011, 16:34   #1
Desbrina
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
Desbrina is offline   Reply With Quote
Old 19th May 2011, 16:42   #2
DrO
-
 
DrO's Avatar
 
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
DrO is offline   Reply With Quote
Old 19th May 2011, 17:57   #3
Desbrina
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
Desbrina is offline   Reply With Quote
Old 19th May 2011, 18:01   #4
DrO
-
 
DrO's Avatar
 
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
DrO is offline   Reply With Quote
Old 19th May 2011, 18:06   #5
Desbrina
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.
Desbrina is offline   Reply With Quote
Old 19th May 2011, 18:11   #6
DrO
-
 
DrO's Avatar
 
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
DrO is offline   Reply With Quote
Old 19th May 2011, 23:27   #7
jaromanda
Major Dude
 
jaromanda's Avatar
 
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
  1. Ask a teenager
That should do it
jaromanda is offline   Reply With Quote
Old 19th May 2011, 23:43   #8
DrO
-
 
DrO's Avatar
 
Join Date: Sep 2003
Location: UK
Posts: 22,244
Quote:
Originally Posted by jaromanda View Post
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
and i've said i'm going to add the bloody support for it into sc_trans, geez. most of the testui code needs to be cleaned up, etc anyway but i have more pressing things to do than that at the moment hence why it's almost 1am my time and i'm still working!

-daz
DrO is offline   Reply With Quote
Old 20th May 2011, 02:28   #9
jaromanda
Major Dude
 
jaromanda's Avatar
 
Join Date: Jun 2007
Location: NSW Australia
Posts: 1,655
Quote:
Originally Posted by DrO View Post
and i've said i'm going to add the bloody support for it into sc_trans, geez.
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
  1. Ask a teenager
That should do it
jaromanda is offline   Reply With Quote
Old 20th May 2011, 06:31   #10
Desbrina
Junior Member
 
Join Date: May 2011
Posts: 9
I'm pretty confident with php but can't work out how I'd do it
Desbrina is offline   Reply With Quote
Old 20th May 2011, 22:07   #11
hackerdork
Forum King
 
hackerdork's Avatar
 
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.
hackerdork is offline   Reply With Quote
Reply
Go Back   Winamp Forums > SHOUTcast > SHOUTcast Discussions

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump