webplayer 设置加载图标和屏蔽右键

以下是引用片段:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title>Unity Web Player | WebPlayer</title>
  <script type="text/javascript" src="http://webplayer.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject.js"></script>
  <script type="text/javascript">
  <!--
  function GetUnity() {
   if (typeof unityObject != "undefined") {
    return unityObject.getObjectById("unityPlayer");
   }
   return null;
  }
  if (typeof unityObject != "undefined") {

          var myWidth = 0, myHeight = 0, borderSize = 20;
              if( typeof( window.innerWidth ) == 'number' ) {
                //Non-IE
                myWidth = window.innerWidth - borderSize;
                myHeight = window.innerHeight - borderSize;
              } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
                //IE 6+ in 'standards compliant mode'
                myWidth = document.documentElement.clientWidth - borderSize;
                myHeight = document.documentElement.clientHeight - borderSize;
              } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
                //IE 4 compatible
                myWidth = document.body.clientWidth - borderSize;
                myHeight = document.body.clientHeight - borderSize;
              }

        var params = {
        backgroundcolor: "000000",
        bordercolor: "000000",
        textcolor: "FFFFFF",
        //logoimage: "MyLogo.png",
        //progressbarimage: "MyProgressBar.png",
        //progressframeimage: "MyProgressFrame.png"
        disableContextMenu: true
        };
        unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d", myWidth, myHeight, params);

    }
    -->
    </script>
    <style type="text/css">
    <!--
    body {
        font-family: Helvetica, Verdana, Arial, sans-serif;
        background-color: black;
        color: white;
        text-align: center;
    }
    a:link, a:visited {
        color: #000;
    }
    a:active, a:hover {
        color: #666;
    }
    p.header {
        font-size: small;
    }
    p.header span {
        font-weight: bold;
    }
    p.footer {
        font-size: x-small;
    }
    div.content {
        margin: auto;
        width: 100%;
    }
    div.missing {
        margin: auto;
        position: relative;
        top: 50%;
        width: 193px;
    }
    div.missing a {
        height: 63px;
        position: relative;
        top: -31px;
    }
    div.missing img {
        border-width: 0px;
    }
    div#unityPlayer {
        cursor: default;
        height: 100%;
        width:  100%;
    }
    -->
    </style>
</head>
<body>
    <!-- <p class="header"><span>Unity Web Player | </span>WebPlayer</p> -->
    <div class="content">
        <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>
    </div>
    <!-- <p class="footer">&laquo; created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> &raquo;</p> -->
</body>

################## 下面为修改代码的主体部分 ####################

     var params = {<!--这些是更改加载图标-->
     backgroundcolor: "A0A0A0", 
     bordercolor: "000000", 
     textcolor: "FFFFFF", 
     logoimage: "MyLogo.png", 
     progressbarimage: "MyProgressBar.png", 
     progressframeimage: "MyProgressFrame.png",
     <!--这个是屏蔽右键-->
     disableContextMenu: true
     };
    unityObject.embedUnity("unityPlayer", "WebPlayer.unity3d",  "100%", "100%", params);

 

转载于:https://my.oschina.net/jieshu/blog/99910

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值