I’ve put my project online ([here](http://www.devinwilson.net/On and On/On and On.html)) and the web player has worked fine so far on Windows machines and Mac OS X machines that already have the Unity web plug-in, but I had someone without the plug-in go to the page with their MacBook Pro and when they clicked to install the plug-in, they just got a useless-404-dummy page from my host. I uploaded the .dmg that it was looking for to the location it was looking for it in, but it doesn’t download it. It just tries to display the .dmg in the browser (a bunch of nonsense characters, etc).
How do I make it so the install button re-directs users correctly?
Thanks!
sounds like you touched the html cause otherwise it wouldn’t look on your host but would go to the unity page as only they are entitled to distribute the webplayer
Hi DevWil, we had the same problem, only seemed to affect the macs.
Its a bit of a hack but i believe this is a problem in the UT hosted UnityObject.js so we can remove the workaround once they fix it.
<!doctype html>
<html>
<head>
<meta charset="ISO-8859-1"/>
<title>Unity Player</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script>
<script type="text/javascript">
if (typeof unityObject != "undefined")
{
var params = {
backgroundcolor: "FFFFFF",
bordercolor: "FFFFFF",
textcolor: "FFFFFF",
logoimage: "preloader.png",
progressbarimage: "bar.png",
progressframeimage: "frame.png"
};
unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", 800, 600, params, null, UnityLoaded);
}
function GetUnity()
{
if (typeof unityObject != "undefined")
{
return unityObject.getObjectById("unityPlayer");
}
return null;
}
function UnityLoaded(result)
{
if(!result.success)
{
var fileURL = $("#unityPlayer > div > a").attr("href");
if(fileURL.indexOf(".dmg")!=-1)
{
$("#unityPlayer > div > a").attr("href","http://webplayer.unity3d.com/download_webplayer-3.x/"+fileURL.substring(fileURL.lastIndexOf("/")));
}
}
}
</script>
</head>
<body>
<div id="unityPlayer">
<div class="missing">
<a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now!">
<img alt="Unity Web Player. Install now!" src="http://webplayer.unity3d.com/installation/getunity.png" width="193" height="63" />
</a>
</div>
</div>
</body>
</html>
i just need to plug in the following part of the code into my html file, right? the rest of that code looks the same as what i already have (except the stuff in the middle specific to my game)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script>
<script type="text/javascript">
and that’s it?
you do need to have the jquery script included but you also need to use the Unityloaded function to rewrite the bad link