[RESOLVED] Web player wrong size in table?

I have tried putting the web player object into a simple HTML table so that I could frame graphics around it.

but there’s a gap that I can’t get rid of and I’ve tried everything I can think of.

here’s what it looks like:

html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="919">
  <tr>
   <td>[img]spacer.gif[/img]</td>
   <td>[img]spacer.gif[/img]</td>
   <td>[img]spacer.gif[/img]</td>
   <td>[img]spacer.gif[/img]</td>
  </tr>

  <tr>
   <td rowspan="3">[img]left.jpg[/img]</td>
   <td>[img]top.jpg[/img]</td>
   <td rowspan="3">[img]right.jpg[/img]</td>
   <td>[img]spacer.gif[/img]</td>
  </tr>
  <tr>
   <td><object id="UnityObject" classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" height="540" width="810">
        <param name="src" value="TheTrenchRun.unity3d" />
        <param name="backgroundcolor" value="101010">
        <param name="borderdcolor" value="101010">
        <embed id="UnityEmbed" src="TheTrenchRun.unity3d" type="application/vnd.unity" backgroundcolor="101010" pluginspage="http://www.unity3d.com/unity-web-player-2.x" height="540" width="810" bordercolor="101010" backgroundcolor="101010">
      </embed></object></td>
   <td>[img]spacer.gif[/img]</td>
  </tr>
  <tr>
   <td>[img]bottom.jpg[/img]</p></td>
   <td>[img]spacer.gif[/img]</td>
  </tr>
</table>
</body>
</html>

Can anyone tell me why that’s happening? is there some known issue with the web player taking up more room than it’s told to? I’ve checked that the stage area that displays the game is what I set it to (810x540).

any help is very much appreciated :wink:

it seems to me that the web player is also not positioning itself on the page where I expect it to be - which would make sense why the table is getting pushed like it is.

Anyone have experience with this?

The issue is that firefox/safari seem to have issues when you have object and embed tags together - which, btw, is exactly what unity writes out for you:

if (DetectUnityWebPlayer()) 
				{					
					document.write('<object id="UnityObject" classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" width="810" height="540"> \n');
					document.write('  <param name="src" value="TheTrenchRun.unity3d" />\n'); 
					document.write('  <param name="backgroundcolor" value="101010" />\n');
					document.write('  <param name="borderdcolor" value="101010" />\n');
					document.write('  <param name="logoimage" value="preloader_base.png" />\n');
					document.write('  <param name="progressbarimage" value="preloader_bar.png" />\n');
					document.write('  <param name="progressframeimage" value="preloader_bar_bg.png" />\n');
					document.write('  <embed id="UnityEmbed" src="TheTrenchRun.unity3d" width="810" height="540" type="application/vnd.unity" backgroundcolor="101010" logoimage="preloader_base.png" progressbarimage="preloader_bar.png" bordercolor="101010" progressframeimage="preloader_bar_bg.png" pluginspage="http://www.unity3d.com/unity-web-player-2.x" /> \n');
					document.write('</object>');
				
				}

So, (thanks to Andy Zupko btw), we put in a check to see which browser we were in and then wrote out the object if we were in IE/win, otherwise, we wrote out the embed tag.

Without it, the web player area is taking up more area than you would expect it to, hence the title of the post :wink:

<body bgcolor="#ffffff">
	<center>
<table border="0" cellpadding="0" cellspacing="0" width="919">

  <tr>
   <td>[img]spacer.gif[/img]</td>
   <td>[img]spacer.gif[/img]</td>
   <td>[img]spacer.gif[/img]</td>
   <td>[img]spacer.gif[/img]</td>
  </tr>

  <tr>
   <td rowspan="3">[img]left.jpg[/img]</td>
   <td>[img]top.jpg[/img]</td>
   <td rowspan="3">[img]right.jpg[/img]</td>
   <td>[img]spacer.gif[/img]</td>
  </tr>
  <tr>
   <td width="810" height="540">
	<div style="width:810;height:540; overflow:hidden;">
   	<script>
	var isIE  = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
	var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
	var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
	
	if (DetectUnityWebPlayer()) 
	{
		if (isIE  isWin  !isOpera)
			{
				document.write('<object id="UnityObject" classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" width="810" height="540" style="margin:0;padding:0;"> \n');
				document.write('  <param name="src" value="TheTrenchRun.unity3d" />\n'); 
				document.write('  <param name="backgroundcolor" value="131313" />\n');
				document.write('  <param name="bordercolor" value="131313" />\n');
				document.write('  <param name="logoimage" value="preloader_base.png" />\n');
				document.write('  <param name="progressbarimage" value="preloader_bar.png" />\n');
				document.write('  <param name="progressframeimage" value="preloader_bar_bg.png" />\n');
			document.write('</object>');
		}else{
				document.write('  <embed id="UnityEmbed" src="TheTrenchRun.unity3d" width="810" height="540" type="application/vnd.unity" backgroundcolor="131313" logoimage="preloader_base.png" progressbarimage="preloader_bar.png" progressframeimage="preloader_bar_bg.png" pluginspage="http://www.unity3d.com/unity-web-player-2.x" bordercolor="131313" border="0" style="padding:0;margin:0;"/> \n');
		}
	}
	else {
				
		var installerPath = GetInstallerPath();
		if (installerPath != "") {
			// Place a link to the right installer depending on the platform we are on. The iframe is very important! Our goals are:
			// 1. Don't have to popup new page
			// 2. This page still remains active, so our automatic reload script will refresh the page when the plugin is installed
			document.write('<div align="center" id="UnityPrompt"> \n');
			document.write('  [url=""][img]http://webplayer.unity3d.com/installation/getunity.png[/img][/url] \n');
			document.write('</div> \n');
			
			// By default disable ActiveX cab installation, because we can't make a nice Install Now button
//						if (navigator.appVersion.indexOf("MSIE") != -1  navigator.appVersion.toLowerCase().indexOf("win") != -1)
			if (0)
			{	
				document.write('<div id="InnerUnityPrompt"> 

Title</p>');
				document.write('

 Contents</p>');
				document.write("</div>");

				var innerUnityPrompt = document.getElementById("InnerUnityPrompt");
				
				var innerHtmlDoc =
					'<object id="UnityInstallerObject" classid="clsid:444785F1-DE89-4295-863A-D46C3A781394" width="320" height="50" codebase="http://webplayer.unity3d.com/download_webplayer-2.x/UnityWebPlayer.cab#version=2,0,0,0">\n' + 
					'</object>';
					
				innerUnityPrompt.innerHTML = innerHtmlDoc;
			}

			document.write('<iframe name="InstallerFrame" height="0" width="0" frameborder="0">\n');
		}
		else {
			document.write('<div align="center" id="UnityPrompt"> \n');
			document.write('  [url="javascript: window.open("][img]http://webplayer.unity3d.com/installation/getunity.png[/img][/url] \n');
			document.write('</div> \n');
		}
		
		AutomaticReload();
	}
</script>
</div>

   </td>
   <td>[img]spacer.gif[/img]</td>
  </tr>
  <tr>
   <td>[img]bottom.jpg[/img]</td>
   <td>[img]spacer.gif[/img]</td>
  </tr>
</table>
</center>
</body>
</html>

blamo - works great!