Results 1 to 4 of 4

Thread: QueryString in onConnect method always empty

  1. #1
    Join Date
    Dec 2012
    Posts
    8

    Default QueryString in onConnect method always empty

    Greetings,

    I'm attempting to retrieve the query string information via client.getQueryString() within the onConnect method. However, this method always returns an empty string. For example:

    ffmpeg -i "rtmp://localhost:1935/[appname]/[streamname]?param1=test&param2=test"

    Any suggestions?

    Edit: As a follow up, is there any way to pass param data via an rtmp string like above so that I can access it like this:

    String username = getParamString(params, PARAM1);
    String password = getParamString(params, PARAM2);

    Thanks,
    Nick
    Last edited by nkarnick; 02-21-2013 at 11:09 AM.

  2. Default

    Put the query variables on the URL, not the stream. Try this:

    ffmpeg -i rtmp://localhost:1935/[appname]?param1=test&param2=test/[streamname]

  3. #3
    Join Date
    Dec 2007
    Posts
    21,962

    Default

    Also, you can't use params like that in this case. Do this:

    String[] auth = client.getQueryStr().split("&");		
    username = auth[0];
    password = auth[1];
    Richard

  4. #4
    Join Date
    Dec 2012
    Posts
    8

    Default

    I'll give it a shot, thanks guys.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •