Wowza Community

Client side player detection

I may have totally missed it, but I’ve searched this site and forum and haven’t run across the answer to this yet.

My company is evaluating wowza for purchase. One of the things we were hoping for is some kind of javascript (or other method) supplied by wowza that we could embed in our existing pages to detect the clients browers and/or device and automatically switch to the correct player and stream. For instance…

html page

if iPhone

iPhone player + iPhone stream url

else if android

android player + android url

elseif IE + flash installed

flash player + flash url

etc.

Some basic code that runs in the client’s browser, detects what kind of player and stream should be used, and adds that html code to the web page at render time so the correct player or and the correct wowza stream url format are dynamically selected to that one web page is compatible with many platforms and devices.

Thanks

its job for apache … not for wowza … but its not problem in PHP … look at phpinfo page …

You can do IClient.getUserAgent() in onConnect, or HTTPSession.getUserAgent() in *SessionCreate handlers, but that’s not where that info is useful. You need to look at UserAgent in application server page (php, asp, etc) or in Javascript to do anything useful to form the html correctly for that client.

Richard

There is a Quickstart, tutorials and other examples and articles here:

https://www.wowza.com/docs/

And in the /examples folder where Wowza is installed there are other examples that include /client* folders with different playback clients that you can try.

Richard

The user-agent info that can be used in client-side solutions is available and the same in your application server: cold fusion, .net, php, etc. And it is better to do it there because you are not affected by users turning off javascript. You can find articles and examples if you search for “detect user agent”, or “ios user agent”.

Richard

Sorry, I think I partly confused this with another thread from today. I should point out this example first:

http://blog.ianbeyer.com/code/client/browser-aware-player-code/

Now the previous statement has some context.

Reading back on this thread, I see it is more about Wowza providing this bridge or some path or framework to accomplish this, and we don’t have that right now. It has been looked at but it is difficult to generalize in javascript, and it is better to do it server-side where there are many different application servers. Ian’s example is a good starting place, even for app server-side solution.

Richard

There are tons of examples out there, as I’ve mentioned, application server examples: asp, php, jsp, or cold fusion. That’s where you would do this, not in Wowza. Evaluate userAgent in your app server as you are forming the html for a response to a client request.

Richard

We don’t use apache or PHP, we use Coldfusion. But if I understand you, you’re suggestion we do the detection server side. That’s fine, we can do that, I was just hoping that wowza supplied the detection code that tied into the rest of their solution. It’s great that wowza can stream to so many platforms and devices, but it would be a more complete solution if there was also “detection code” for all those platforms too. Thanks

Yes, I understand how to do server side. To reiterate… I was hoping that the detection scripts, whether server side or client side, were already available in some wowza forum or library somewhere. It would make the server product more of a complete offering to customers. Thanks

Yes, thanks. I have seen that collection of articles, but I haven’t found specifically what I’m looking for so I don’t know if it’s there somewhere. I may not have explained my needs clearly the first time, I’ll try again. Maybe someone could point me to an article in that collection if one exists…

I run a corporate website. My marketing dept wants to embed videos-on-demand on certain pages. They’d prefer if the videos played in a player/plugin embedded in the page, but if for some reason on some device it needed to be a plain hyperlink straight to a video file that’s ok too. The core requirement is that our videos will play on as many different OS & device combinations as possible without creating multiple pages all designed for different devices. Here’s what I have so far…

When a customer requests a page from my web server (call it www.xyz.com), Coldfusion will detect (server-side) what the customer’s http_user_agent is. That will give my Coldfusion server information like browser, version, possibly OS, etc. Coldfusion needs to then return a web page back to the customer that includes html (or javascript) that embeds the appropriate player/plugin, and that player must point to a video stream appropriate for that player/plugin. That vod asset file will physically live on my Wowza server (wowza.xyz.com) so that means I’m not doing user_agent detection or any coding on the wowza server at all.

If the customer is on IE with a Flash plugin, I need to return a page that embeds the Flash player pointed at http://wowza.xyz.com:1935/vod/mp4:myvideo.mp4/manifest.f4m

If the customer is on an iPhone I need to return a page that embeds the default iPhone player pointed at http://wowza.xyz.com:1935/vod/mp4:myvideo.mp4/playlist.m3u8

and so on

This needs to be as cross platform, cross browser, cross player plugin as possible so that it plays seamlessly for everyone, so the first thing I’m doing is I’m going to encode MP4, H.264, AAC because I want universal vod asset files. Next, on the server side (www), when processing the customer’s request, I need to do something like this…

(Coldfusion, server-side)

If user agent is…

IE

return html w/embedded Flash player

if no Flash, embed Silverlight

if no Silverlight, hyperlink to mp4 file

Safari

return html w/embedded default apple video player

Android

return html w/embedded Flash player

if no Flash, hyperlink to mp4 file

etc

Does that make more sense? I know I entitled this article “client side player detection” but I didn’t mean I wanted to detect the player on the client side, I know that’s done on the server side, what I meant was I need to detect what client they’re running so I know what html to return, what player to embed, what vod asset to link to, etc.

Are there any articles that handle the most common browsers/players/plugins/devices on the server-side? Even if the code is PHP or .Net I can convert it to Coldfusion, that’s not a problem, it’s just coming up with a universal server-side code set that detects client environment and returns the proper player/plugin/stream link format.

Thanks

Reading back on this thread, I see it is more about Wowza providing this bridge or some path or framework to accomplish this, and we don’t have that right now. It has been looked at but it is difficult to generalize in javascript, and it is better to do it server-side where there are many different application servers.

Thanks, I agree, but that’s what I’ve been asking for all along… examples of server-side code. I want to detect user_agent on the server side and return a web page that already has the proper player / plugin embedded in the html, pointed at the correct wowza vod url. I’d rather not use javascript if I can help it. Can someone point me to some server-side examples?

Hi dhoule, I do agree 100% with you.

I was looking for the same, a basic package with script examples for server side and client side to simplify things for 1st time user and help you jump start testing wowza capabilities.

It doesn’t even have to cover more than one server type or programing language.