A_Grant
11-25-2009, 02:04 AM
I have this simple script that uses and if then statement. The point of this is to show one video player for an iphone and a flash player for everything else. I am using the "document.write" function for writing the embed codes, but the quotes close the function. I tried using /" before every quote and it didn't work for me. I also tried wrapping the embed function in a single quote..that did not work either.
I don't know a lot about javascript, but would love to have this script..
Please help! I hate to be a beggar but I can't seem to find my solution online.
Here is the code
<script type="text/javascript">
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
document.write("iPhone embed code here");
}
else
{
document.write("<embed src='player.swf' width='470' height='290' bgcolor='#ffffff' allowscriptaccess='always' allowfullscreen='true' flashvars='file=bunny.flv&streamer=rtmp://edge01.fms.dutchview.nl/botr' />");
}
-->
</script>
I don't know a lot about javascript, but would love to have this script..
Please help! I hate to be a beggar but I can't seem to find my solution online.
Here is the code
<script type="text/javascript">
<!--
if((navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)))
{
document.write("iPhone embed code here");
}
else
{
document.write("<embed src='player.swf' width='470' height='290' bgcolor='#ffffff' allowscriptaccess='always' allowfullscreen='true' flashvars='file=bunny.flv&streamer=rtmp://edge01.fms.dutchview.nl/botr' />");
}
-->
</script>