Getting the user's GEO Location with Wowza Media Server
I was reminded of this topic while reading a few items in the forums on Wowza’s site and thought I would finally get an article out about it.
A while ago we were commissioned for a project to build a video content management system. Within this system there was the request to show log results of how many times videos were played, how much bandwidth was used in a day, month etc and also where the viewer is located on the planet.
Anyways, a bunch of research ensued and we came across the best alternative so far which is from MaxMind. They offer a free and paid for version of a database that has geolocation lookup tables. Here’s one for countries and one for cities.
You now have just about all the tools you need to start figuring out and possibly logging where your users are coming from if you are using Wowza. If you have the Wowza IDE installed then it’s a simple as pie to import the java classes into your project and start taking advantage of them.
From here it’s easy. Read the docs a bit to understand what you have downloaded and then go ahead and create a LookupService, pointing to the location of where your database is at (the .dat file you download from MaxMind). Pass in the users’s ip, which you can get from the client properties clientObj.getIp() and voila! you should now have the location of the user by country, city latitude, longitude and so on. It’s that simple to do!
I encourage you to try it out, being that it’s all contained within Java, you only have to extend your main module out to load in the required classes and instantiate the LookupService and grab the result. Simple.
With all of that, there are 3rd party developers that are happy to share code and a couple of them have gone ahead and put together a module that you can try out
So good luck with it!
Posted by: Graeme Bull on Sep 05, 2011
Share This Article
Willow | Wowza Media Server Management made easy
Willow is the answer to any Wowza Media Server developer's or administrator's problem of how to see what your Wowza Media Server is doing at any one time.We created Willow to meet our needs to be able to see what is going with our applications and servers publishing and playing all types of streams and shared objects.