I fully realease that my contribution now, has been posted a long time after the original.
But I like to suggest that maybe it would be better to detect if the OS (operating system) is Windows.
( as there are so many different browsers, some of which can proport to be another ) ;-)
How about
[code]
<SCRIPT TYPE="text/javascript">
<!--
if (navigator.appVersion.indexOf == "Win")
document.writeln ('<a href="http://www.streamerp2p.com/phasex.php?id=XXXXX" target="_blank">Tune In</a>');
// -->
</SCRIPT>
<NOSCRIPT>
<a href="streamerp2p://">Tune In</a>
</NOSCRIPT>
[/code]
oviously as there is presently NO non-Windows version of Steamer
hense the "elseif" is no longer required (which is why it missing from my example above) !
How-ever if you can offer a conventional stream (tcp, Icecast, Shoutcast etc)
then for non-Windows users, we could use the "else" to incert a link to the non-p2p stream
So the stript becomes (using my station as an example)
[code]
<SCRIPT TYPE="text/javascript">
<!--
if (navigator.appVersion.indexOf == "Win")
document.writeln ('<a href="http://www.streamerp2p.com/phasex.php?id=28358" target="_blank">Tune In</a>');
else
document.writeln ('<a href="http://87.117.192.112/DFI/demo_mp3.pls" target="_blank">Tune In</a>');
// -->
</SCRIPT>
<NOSCRIPT>
<a href="http://87.117.192.112/DFI/demo_mp3.pls">Tune In</a>
</NOSCRIPT>
[/code]
regards 2xQ
PS: this script could maybe also be expanded to detect browser type
or even if streamer is already installed ( thou I gess that would require a cook'e )
or maybe you know better,, Please share ;-)
PPS: I intend to play with the modified version of the script, in order to create a version
which hides the tune-streamerP2P button from view
when a non-windows visitor is viewing my station website
as I beleave there is little point in presenting them with a feature that they cannt use :-(
Reference, and script for the detection of ALL common OS's can be found here
http://www.javascripter.net/faq/operatin.htm enjoy !!