Wowza Community

Onstreamcreate - getQueryStr()

Hello,
I need to do certain actions based on the query parameters on the request So I am trying to access the query parameters when the stream starts but I am getting the empty with the getQueryStr​() method.

public void onStreamCreate(IMediaStream stream) {
getLogger().error("onstreamcreate "+stream.getQueryStr());
}

WSE version; 4.8.10

Please help me with how to get the query parameters?

You should be able to call client.getQueryStr().toString() to obtain the parameters from the incoming source.

Is that what you are looking for?

If you are looking for parameters for playback, we may need to check if the player is sending a query stream at all. If not, it’ll be null. Send us a support ticket and we’d be happy to walk you through this.

Hi,

I tried by calling stream.getClient().getQueryStr().toString() which is throughing NullPointer exception.

Sample code block

public void onStreamCreate(IMediaStream stream) {
     getLogger().error("onstreamcreate "+stream.getClient().getQueryStr().toString());  //excepting e=123
}

Sample URL:
http://121.0.0.1/cdn-live/definst/testfeed/playlist.m3u8?e=123

Is that what you are suggesting?

That’s what I was told yes, but we will need a support ticket to further investigate. It’s impossible to diagnose in the forums without full access to your configuration and files you see. In order to help you accurately resolve this, can you submit a ticket to us today? Thanks @Kousthub_Gangarapu