我正在尝试使用 SilverStripe CMS 2.4.5 版将 Unity3D (www.unity3d.com) 网络播放器添加到我的站点中。似乎发生的事情是 SS 正在动态删除包含网络播放器的我的代码。它留下一个结束 div 标签。
一个简单的静态页面嵌入网络播放器真的很简单。您需要以下代码,它可以完美运行。HTML:
<script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script>
<script type="text/javascript">
<!--
//gets the unityPlayer div and replaces the content with an embed tag which is the web player made by Unity (it works outside of SS.)
function GetUnity() {
if (typeof unityObject != "undefined") {
return unityObject.getObjectById("unityPlayer");
}
return null;
}
//sets the parameters of the web player
if (typeof unityObject != "undefined") {
unityObject.embedUnity("unityPlayer", "MazePuzzle.unity3d", 720, 450);
}
-->
</script>
<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>