Wowza Community

Custom HTTP Provider

Hello,

I am looking for more information on how to create a custom HTTP provider to user with the REST API. Right now I am having to call 2 different ones to get the information I need to display information about the stream. So I would like to condense it into one single call so I have all the information I need in a single JSON file. What I am looking to have in one single file is this.

Stream Status

Total Viewers

Audio Status (If the stream has audio or not)

Now I can pull the stream status and total viewers but they are in two seperate calls and would like to combine them into a single request so I do not have to make multiple requests to get different information. Can anyone provide some information on how I can achieve this and the process to build this. I am not good with Javascript but I am sure I could take the snippets from the others to combine into a single file. Just not sure what I would use for the audio status. Then what all is involved in creating this?

-Thanks

Hi Nick,

We do have an example HTTPProvider code that generates connection counts. This code is a snapshot of the current counts, though, and not a historic statistic, which is what it sounds like you’re looking for. You will need to customize this in order to query the stats database.

We are working on allowing users to create their own REST API endpoints as well, but I don’t have a timeline yet as to when this becomes available.

Michelle

Thanks for the response. I think you may have misunderstood what I was requesting. I can already pull total viewer counts of a stream and the stream status as I stated in my second paragraph. Problem with that is I have to make two separate calls to get the information I am needing. I.E. One for the stream status (Online/Offline) and then another call to get the viewer counts. I would like to combine this information into a single call so I don’t have to create multiple HTTP requests in my scripts to get the information I need.

In addition to combining the stream status and connection counts, I would like to add audio status I.E. if the stream has audio or not.

Is this possible to do to combine HTTP providers into a single file and also is there one for audio?

-Thanks

In your custom HTTProvider code, you can query the application’s ConnectionInfo similar to the code previously provided. You can also call getPublishAudioCodecId() on the IMediaStream objects for the application and check if it is a non-null value to see if it has an audio track.

In a reply a couple years ago it was mentioned above…

“We are working on allowing users to create their own REST API endpoints as well, but I don’t have a timeline yet as to when this becomes available.”

Is this now available or is it still in development? This is something I think would be extremely useful.

I desperately need to the point I would pay for a custom end point that would show the following listed below for all activate streams on the server from a single URL request.

{
  "name": "name",
  "streamName": "streamname",
  "applicationName": "AppName",
  "isConnected": true,
  "totalConnections": 1,
}

I guess this functionality is not something that is available yet?

Let me check for you @Nick Copeland.

Try this endpoint @Nick Copeland:

/v2/servers/{serverName}/vhosts/{vhostName}/applications/{appName}/instances/{instanceName}/incomingstreams/{streamName}/monitoring/current

Thanks, but that is what I am currently using and not what I am looking for.

I need one that shows ALL incoming and active streams for an application.

That one only shows it for a single incoming stream. I need something that shows all incoming streams into an application that shows the following variables in a single provider as follows.


  1. {
  2. “name”:“name”,
  3. “streamName”:“streamname”,
  4. “applicationName”:“AppName”,
  5. “isConnected”:true,
  6. “totalConnections”:1,
  7. }

Ok let me check back with the engineers to see if we have that.

Unfortunately @Nick Copeland, I checked with the engineers for you and we do not have a way for you to do this right now.

You would still have to use two REST API calls:

-One call to get all the streams and then a second to pull the information for each stream - there isn’t one which does both combined.

Sadly I am aware there isn’t a single provider which makes working with this API a nightmare for dynamic realtime content and I would pay good money to have something custom written. There is NO provider that will allow you to monitor all incoming streams for a single application which IMO I feel this is a real oversight on Wowza’s part that something like this doesn’t exist or users are able to easily create themselves and the one setback that keeps me on a month to month as needed basis with Wowza instead of going all in with the Perpetual Lic since development of the API is lacking severely and there has not been any additions to or updates to it in years and several other posts on here echo that. From a web development standpoint this is one of the most poorly written and difficult API’s to work with. Please get it together Wowza, you have a great streaming solution, but the API desperately needs some attention.

Thank you for this feedback and I’m passing it on to the API team. Please know I hear you and appreciate you sharing this.