首页 > Unity3D专栏 > 【Unity3D】failed to update unity web player解决办法。
2017
07-25

【Unity3D】failed to update unity web player解决办法。

相信很多人都遇到过“failed to update unity web player

这个解决的方法只针对开发者哦~

需要改生成的html

对照着修改一下~就可以了。

<!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>  
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">  
        <title>Unity Web Player | Test1</title>  
        <script type="text/javascript" src="http://wp-china.unity3d.com/unity/jquery.min.js"></script>  
        <script type="text/javascript">  
            var unityObjectUrl = "http://wp-china.unity3d.com/download_webplayer-3.x/3.0/uo/UnityObject2.js";  
            if (document.location.protocol == 'https:')  
            unityObjectUrl = unityObjectUrl.replace("http://", "https://ssl-");  
            document.write('<script type="text\/javascript" src="' + unityObjectUrl + '"><\/script>');  
        </script>  
        <script type="text/javascript">  
        <!--  
            var config = {  
                width: 960,   
                height: 600,  
                params: { enableDebugging:"0",  
                baseDownloadUrl: "http://wp-china.unity3d.com/download_webplayer-3.x/",  
                autoupdateURL : "http://wp-china.unity3d.com/autodownload_webplugin-3.x",  
                autoupdateURLSignature : "02a5f78b3066d7d31fb063186a2eec36fdf1205d49c6b0808eb37ef85ed9902e2e1904d87f599238a802ba0abbfe4f18aa82dd2eb5171e99ba839a5cea9e6ea9c1be9eae505937b56fe4a5fd254cffe08958d961f42d970136b5eab9e6c2cd08b81bc8a11e5ade57dc63dcfef2248d89689e4d4feed3cdfe7374c848fd57ebd4"  
                 }  
                  
            };  
            var u = new UnityObject2(config);  
  
            jQuery(function() {  
  
                var $missingScreen = jQuery("#unityPlayer").find(".missing");  
                var $brokenScreen = jQuery("#unityPlayer").find(".broken");  
                $missingScreen.hide();  
                $brokenScreen.hide();  
                  
                u.observeProgress(function (progress) {  
                    switch(progress.pluginStatus) {  
                        case "broken":  
                            $brokenScreen.find("a").click(function (e) {  
                                e.stopPropagation();  
                                e.preventDefault();  
                                u.installPlugin();  
                                return false;  
                            });  
                            $brokenScreen.show();  
                        break;  
                        case "missing":  
                            $missingScreen.find("a").click(function (e) {  
                                e.stopPropagation();  
                                e.preventDefault();  
                                u.installPlugin();  
                                return false;  
                            });  
                            $missingScreen.show();  
                        break;  
                        case "installed":  
                            $missingScreen.remove();  
                        break;  
                        case "first":  
                        break;  
                    }  
                });  
                u.initPlugin(jQuery("#unityPlayer")[0], "Scene.unity3d");  
            });  
        -->  
        </script>  
        <style type="text/css">  
        <!--  
        body {  
            font-family: Helvetica, Verdana, Arial, sans-serif;  
            background-color: white;  
            color: black;  
            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: 960px;  
        }  
        div.broken,  
        div.missing {  
            margin: auto;  
            position: relative;  
            top: 50%;  
            width: 193px;  
        }  
        div.broken a,  
        div.missing a {  
            height: 63px;  
            position: relative;  
            top: -31px;  
        }  
        div.broken img,  
        div.missing img {  
            border-width: 0px;  
        }  
        div.broken {  
            display: none;  
        }  
        div#unityPlayer {  
            cursor: default;  
            height: 600px;  
            width: 960px;  
        }  
        -->  
        </style>  
    </head>  
    <body>  
        <p class="header"><span>Unity Web Player | </span>Test1</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://http://wp-china.unity3d.com/installation/getunity.png" width="193" height="63" />  
                    </a>  
                </div>  
                <div class="broken">  
                    <a href="http://unity3d.com/webplayer/" title="Unity Web Player. Install now! Restart your browser after install.">  
                        <img alt="Unity Web Player. Install now! Restart your browser after install." src="http://wp-china.unity3d.com/installation/getunity.png" width="193" height="63" />  
                    </a>  
                </div>  
            </div>  
        </div>  
        <p class="footer">« created with <a href="http://unity3d.com/unity/" title="Go to unity3d.com">Unity</a> »</p>  
    </body>  
</html>  

 



虚拟世界提醒您:如果您觉得本文不错,快快将这篇文章分享出去吧 ,感谢您的支持和关注,谢谢!
最后编辑:
作者:虚拟世界
专注互联网技术及资讯 技术研究中心|有相关Unity3D问题或者作事宜请联系我哦!
捐 赠如果您愿意花10块钱请我喝一杯咖啡的话,请用手机扫描二维码即可通过支付宝或者微信直接向我捐款,在此非常感谢您对虚拟世界的捐赠。

留下一个回复

你的email不会被公开。