You can check the Client object. It contains a method for obtaining a stream URI.
Something like that:.
@Override public void onPublish(IMediaStream stream, String streamName, boolean isRecord, boolean isAppend) { IClient client = stream.getClient(); String uri = client.getUri();
The Client object also contains methods for receiving a query using client.getQueryStr() and other convenient methods, which you can see in the api documentation on the server side.
source share