returnjson.dumps({"code":Error.success,"urls":{"api":"the api root"}})
defOPTIONS(self,*args,**kwargs):
enable_crossdomain();
# HTTP RESTful path.
classApi(object):
exposed=True
def__init__(self):
self.v1=V1()
defGET(self):
enable_crossdomain();
returnjson.dumps({"code":Error.success,
"urls":{
"v1":"the api version 1.0"
}
});
defOPTIONS(self,*args,**kwargs):
enable_crossdomain();
# HTTP RESTful path. to access as:
# http://127.0.0.1:8085/api/v1/clients
classV1(object):
exposed=True
def__init__(self):
self.clients=RESTClients()
self.streams=RESTStreams()
self.sessions=RESTSessions()
self.chats=RESTChats()
self.servers=RESTServers()
defGET(self):
enable_crossdomain();
returnjson.dumps({"code":Error.success,"urls":{
"clients":"for srs http callback, to handle the clients requests: connect/disconnect vhost/app.",
"streams":"for srs http callback, to handle the streams requests: publish/unpublish stream.",
"sessions":"for srs http callback, to handle the sessions requests: client play/stop stream",
"chats":"for srs demo meeting, the chat streams, public chat room.",
"servers":{
"summary":"for srs raspberry-pi and meeting demo",
"GET":"get the current raspberry-pi servers info",
"POST":{
"body":"the new raspberry-pi server ip."
},
"GET id=ingest&action=play&stream=live/livestream":"play the ingest HLS stream on raspberry-pi",
"GET id=ingest&action=mgmt":"open the HTTP api url of raspberry-pi",
"GET id=meeting":"redirect to local raspberry-pi meeting url(local ignored)",
"GET id=meeting&local=false&index=0":"play the first(index=0) meeting HLS stream on demo.chnvideo.com(not local)",
"GET id=meeting&local=true&index=0":"play the first(index=0) meeting HLS stream on local server(local x86/x64 server), warn: raspberry-pi donot support HLS meeting."