Forum Moderators: open

Message Too Old, No Replies

Embedding Media

Windows Media Player Help

         

dotme

2:32 pm on Mar 19, 2005 (gmt 0)

10+ Year Member



I have a fun side project I'm working on and it involves embedding an audio stream in a web page. The stream runs from a Windows Media Server. So far so good.

Here's the catch -

I don't want to force people who don't have the player to download it. I would prefer to hide the player and not stream at all to those who can't hear it without getting plugins (For mac users, WebTV etc).

I want to make this automated and not make them click a button to tell me whether they have the capability.

Is there an ASP function that will, at the very least, allow me to sense whether the OS of the visitor is Windows/MS, so I could use an IF-THEN to write out the Object tag for the embedded player only if the OS is Windows?

I know - it's an obscure request for a Saturday morning. Any help would be appreciated!

mattglet

12:18 am on Mar 21, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Check the visitor's User Agent string (using Request.ServerVariables) and search for any Windows references. All valid UA strings should be formatted the same (browser; OS; additional info, etc.), so parsing out the values shouldn't be too hard.

dotme

4:32 pm on Mar 21, 2005 (gmt 0)

10+ Year Member



Thanks - I'll give that a try.

dotme

5:32 pm on Mar 23, 2005 (gmt 0)

10+ Year Member



Turns out this required javascript. I found free code that appears to work extremely well. I am including the URL where I found my answer in case anyone else stumbles across this thread with the same problem in the future.

[skyzyx.com...]

Thanks for the help

mattglet

6:11 pm on Mar 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do you do about people that have ActiveX disabled? Or is this not relevant in your case?

Also, is this javascript cross browser compatible? (I haven't tested it out)

dotme

8:14 pm on Mar 23, 2005 (gmt 0)

10+ Year Member



Hi Matt - well, the author claims pretty good compatibility. But I guess in my case, I am trying to err on the side of caution.

"Don't display the player unless it is specifically detected" was my goal. Hopefully it works, but I won't know for a while. The site in question gets enough traffic that I'll hear complaints at some point if it's doing something funky.

mattglet

9:17 pm on Mar 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Nice... Let me know how it goes, this is an interesting bit of code.