Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

How to run unity contents in IE 11 without WebAudio support?

Discussion in 'Web' started by Michael_Her, Mar 27, 2015.

  1. Michael_Her

    Michael_Her

    Joined:
    Jan 8, 2015
    Posts:
    3
    I'm working on computer simulation software company.
    We have a biggest issue how to render huge data visualizations on common web browser and Unity 5.0 WebGL platform may be fit enough, though. But a problem is that Unity 5.0 WebGL is not working on Microsoft IE 11 is most popular web browser now. (IE 11 possess markets 75% over in South Korea)

    I'm making simulation, so don't care about WebAudio supports.

    Is it possible that programmatically force to run Unity WebGL contents in IE 11 without WebAudio support?
     
  2. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Doesn't it actually run on IE without audio right now? You should get a warning message about audio support, but we do nothing to stop you from running.
     
    rameshkumar likes this.
  3. Michael_Her

    Michael_Her

    Joined:
    Jan 8, 2015
    Posts:
    3
    WebGL sample page says,

    First Message
    ---------------------------
    "Please note that your browser is not currently supported for this Unity WebGL content. Try installing Firefox, or press Ok if you wish to continue anyways."
    ---------------------------
    OK CANCEL
    ---------------------------

    >> OK

    Second Message
    ---------------------------
    An error occured running the Unity content on this page. See your browser's JavaScript console for more info. The error was:
    Script error
    ---------------------------
    OK
    ---------------------------

    But I cannot check script error details or console logs, cause IE's F12 console windows automatically closes with first message. (I guess that IE process has gone dead and automatically killed console window toghether.)


    Thanks.
     
  4. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Which WebGL sample page? If you look at the demos posted last year, they probably lack the code to gracefully disable audio when it is not supported, which might explain the error. It should work if you build something with the release version of Unity 5.
     
  5. Michael_Her

    Michael_Her

    Joined:
    Jan 8, 2015
    Posts:
    3
    Sample is written own my hand. This sample is customized to use googlemap APIs for textures.
    It's simple map app.

    Fortunally I solved previous issue with WebGL export on IE 11.

    [Previous problem]
    IE popups following error message.
    "Error: 53
    Not enough storage is available to complete this operation"

    Exporting WebGL, It auto-generates <index.html> file to download Unity contents javascripts(mine is webgl.js) asychronously in page background as below.

    Code (JavaScript):
    1. <script>if (!(!Math.fround)) {
    2.   var script = document.createElement('script');
    3.   script.src = "Release/webgl.js";
    4.   document.body.appendChild(script);
    5. } else {
    6.   var codeXHR = new XMLHttpRequest();
    7.   codeXHR.open('GET', 'Release/webgl.js', true);
    8.   codeXHR.onload = function() {
    9.   var code = codeXHR.responseText;
    10.   if (!Math.fround) {
    11. console.log('optimizing out Math.fround calls');
    12. code = code.replace(/Math_fround\(/g, '(').replace("'use asm'", "'almost asm'")
    13. }
    14.   var blob = new Blob([code], { type: 'text/javascript' });
    15.   codeXHR = null;
    16.   var src = URL.createObjectURL(blob);
    17.   var script = document.createElement('script');
    18.   script.src = URL.createObjectURL(blob);
    19.   script.onload = function() {
    20.   URL.revokeObjectURL(script.src);
    21.   };
    22.   document.body.appendChild(script);
    23.   };
    24.   codeXHR.send(null);
    25. }
    26. </script>
    To solve this problem, I simply replaced it with <script src="Release/webgl.js"></script>, then IE could load Unity contents after a while.


    [Current problem]
    Sample ran well a while and evetually crashes with following error message.


    It says that it's possible to give more information, but I don't have idea how to apply build options.[/code]
     
  6. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Slapping people of certain nationalities is probably not going to get you very far :). Luckily, however, MS is working on a lot of good stuff in the browser departments. I expect that Spartan will at some point be a very good browser to run Unity WebGL content in.
     
  7. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    27
    I am also having this exact same issue and would love to know if there is a solution. I have a game that runs fine in every other browser but I get the 'script error' noted above on IE, with no logs available after the crash.

    You can see the game here: http://stormwarsgame.com and click on the play now button.

    I am wanting to get the game into beta on Kongregate, but they are asking/requiring that we support IE. Any idea what I can do to get the game to run? I am building the game with the latest 5.4.3p2 release.

    Thanks in advance for your help :)
     
  8. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    @JanusAnderson this thread is a year old. Unity WebGL should work on IE (despite audio not working). What exact error are you getting in the console? Do you get a stack trace?
     
  9. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    27
    Hi Jonas, thanks for responding.

    I dug into this today a little more - the error I'm getting is:

    "An error occurred running the Unity content on this page. See your browser's JavaScript console for more info. The error was: Script error". Opening the developer console shows nothing at all.

    I didn't realize that the console was clearing itself when I opened after the crash, so I finally got to the logs and it is simply reporting 'out of memory at line 1'.

    I do have a large memory allocation (500MB) which I'm now guessing IE has a problem with while the other browsers handle well? Sounds like I need to do more work on memory optimization.
     
  10. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    27
    Actually I was able to get the memory allocation down to 256MB and have it run fine in other browsers, but I still just get an out of memory error on IE. Is this still too large or is there anything else that could be causing this?
     
  11. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
  12. JanusAnderson

    JanusAnderson

    Joined:
    Apr 30, 2013
    Posts:
    27
    I spent the day working on this and finally resolved the memory crash in IE. The game runs terribly slow in IE but at least it loads now :) Thanks for your help!