Snow Leopard’s 64-bit Safari and Unity

August 25, 2009 in Technology

Update: We have released Unity 2.6.1 on December 2nd this year, which includes an update to the Mac Unity Web Plugin, which is fully compatible with 64-bit Safari on OS X 10.6 Snow Leopard.

So, most of you have probably heard the news: Apple is going to release Mac OS X 10.6 “Snow Leopard” this Friday. This release will give Mac users plenty of new feature goodness and new technologies to play with, and brings a lot of changes under the hood. Unfortunately, I must inform you that one of these changes may cause some grief for Unity users, at least for the time being:

Apple reengineered Safari to run as a full 64-bit application. While this is a good thing, it has a pretty big impact on plugin developers like us. Even though plugins do not actually need to be 64-bit binaries themselves, since they are now running as separate processes, they need to communicate with Safari using new 64-bit capable APIs. Basically, the old Carbon-based NPAPI is being replaced with a Cocoa-based version, which requires a lot of restructuring of plugin code.

Unfortunately, this change sort of caught us by surprise – the APIs which are now required have just been publically released in Safari 4.0, and are now being made mandatory to use in Snow Leopard less than three months later. Which now means that we won’t be able to ship a working web plugin for 64-bit by it’s release date this friday. We are working on it as hard as we can, and we do have a working proof of concept of Unity web content displaying in 64-bit Safari. We aim to release an updated plugin in October.

Until then, there are two possibly ways to play Unity web content on Snow Leopard: One is to use Firefox, which still works as always. The other one is to set up Safari to run in 32-bit mode. To do that, click Safari in the Finder, select Get Info from the context menu, and click on Open in 32-bit mode.

Setting Safari to use 32-bit mode

When users open web pages with Unity content in 64-bit Safari, all they will see is a blank screen where the content should be. However, it is possible to detect this situation from JavaScript, so you can at least display a meaningful error message on your site. When the plugin fails to load, the GetPluginVersion() function is undefined. Here’s some sample code, showing how to use that to display an error message:


if (navigator.appVersion.indexOf("Safari") != -1
&& navigator.appVersion.indexOf("Mac OS X 10_6") != -1
&& document.getElementById("UnityEmbed").GetPluginVersion == undefined)
{
document.write('<br>You are running Safari in 64-bit mode, which is not yet supported by ')
document.write('the Unity web plugin.<br>');
document.write('To see the content, switch Safari to 32-bit mode, or use Firefox. <br>');
document.write('See <a href="http://blogs.unity3d.com/?p=1358">this blog post</a>');
document.write(' for more information. <br>');
}

If you are using our default html template, you can just add this code after the line document.write(”);.

We apologize for any inconveniences this causes, and, as always, we will try to resolve the issue ASAP. Looking forward, though, moving to these new APIs will make the Unity web experience a better one, as this allows us to do more robust input handling, and proper layering of Unity content with other parts of your web site.

Oh, and before anyone asks: The Unity editor as well as standalone games made with Unity are unaffected by this issue.

Comments (33)

Subscribe to comments
  1. Aras Pranckevičius

    July 4, 2010 at 9:05 am / 

    @leon: we don’t; there’s no 64 bit Safari on Windows that requires the plugins to use Core Animation API.

  2. leon yu

    July 3, 2010 at 8:45 pm / 

    how do you do this on a windows?

  3. rudolfwm

    February 23, 2010 at 2:29 pm / 

    Is this problem solved now?

  4. Ben

    December 11, 2009 at 2:15 am / 

    BTW putting Safari in 32 bit mode did not alleviate the problem for me.

  5. Ben

    December 10, 2009 at 11:11 pm / 

    Have you decided not to pursue a fix for this problem in the 64-bit implementation of Apple’s Snow Leopard?

  6. smith8437

    November 28, 2009 at 12:27 am / 

    I was downloading this on snow leopard and it said domain error safrai 2, what does that mean?

  7. Coreyb

    November 25, 2009 at 8:30 pm / 

    Since it has been a few months, I was just curious if we had an update on the status of the 64-bit version rollout.

  8. fotis

    November 12, 2009 at 5:16 pm / 

    Would be helpful if this information was posted on the download page for the Safari plugin. I’m sure many people not as savvy to search the blog or the forums would have found this information.

  9. robert l faulcon 3rd

    November 9, 2009 at 1:51 am / 

    when i go to download my chaoticgame on line it don,t come in and i can not play the game thnak you .

  10. jonas

    November 6, 2009 at 10:17 am / 

    @Conrad: This is not so much a question about Carbon vs Cocoa. It is a question of using a new API to communicate with the browser. If we had been using the previous, Cocoa web plugin API (WebKit), we would have been just equally screwed, because that is no longer capable of rendering OpenGL content in 64-bit Safari either. This is due to the way plugins are executed out-of-process now.

  11. Conrad Winchester

    November 6, 2009 at 9:14 am / 

    You should not be in the least bit surprised by this. It has not been ‘rushed’ out. Even before Leopard (not Snow Leopard) Apple have been telling developers that they are discontinuing support for carbon (at least 3 years ago). They have continually told developers not to use it, and to use cocoa instead.

  12. Phil Chu

    October 31, 2009 at 2:01 am / 

    Does this mean Unity widgets aren’t working on Snow Leopard? That would be weird, considering I’ve been submitting them to the Apple widget list and Apple’s been accepting them.

  13. Mike

    October 25, 2009 at 1:29 am / 

    I’ve heard there are some wildlife groups trying to get Apple to do more stuff with the actual S.L.’s lol. I don’t know- people are saying it’s good PR for Apple- they should jump on that.

  14. Tom Higgins

    October 20, 2009 at 11:58 pm / 

    @Robert: I’m sorry but that is simply not something we can offer to do, we’re just not in a position to take individual names and notify you about this sort of issue. Please keep your eyes on our News page and/or RSS feed, or these blogs for any updates. Thanks!

  15. robert pfund

    October 19, 2009 at 11:25 pm / 

    Hi can you please contact me, when the 64 bit mode is working on safari with snow leopard.
    Thanks

    Robert

  16. Aras Pranckevičius

    October 5, 2009 at 10:33 am / 

    @Chris: it’s not caused by 64 “bitness” per se. It’s caused by 64 bit Safari deciding “from now on, we’ll force all plugins to use a different set of APIs”. I guess Apple just chose transition to 64 bit as the moment in time to make this change.

  17. Chris

    October 5, 2009 at 12:11 am / 

    I can’t believe that you are that surprised by this, everything, both Windows and Mac, has been heading towards 64-Bit for a couple of years now, so I am always shocked when a company doesn’t support 64-bit yet.

  18. Aras Pranckevičius

    September 1, 2009 at 7:44 am / 

    @Pirks: maybe Apple did let Adobe know about the changes earlier? Also, maybe Flash in Windowed mode does not use OpenGL. Just guessing here, but Flash is very widespead and surely gets a lot more attention than all the smaller web plugins.

    If Flash had the same problems as Unity does, sure, we can do the same fixes. But we need to 1) figure out what and how needs to be fixed, and 2) fix it.

  19. Pirks

    August 31, 2009 at 10:52 pm / 

    Maybe this is still a lousy job on Unity team’s side? I’m asking because 32-bit Flash plugin works just fine on 64-bit Safari _without_ switching Safari into 32-bit mode.

    Why Unity guys couldn’t do the same trick that Adobe did with Flash for OS X?

    Any comments on that? I’m just a curious engineer, would be nice to know how Adobe did that and why Unity team could not do the same. Thanks.

  20. proparjak

    August 31, 2009 at 4:32 pm / 

    Good luck for your strong effort ! Thank you.

  21. Gavin

    August 29, 2009 at 5:35 am / 

    you can go to the application folder in snow leopard, right click on sarafi and get info, and check a box that says open in 32 bit mode. It worked for my 32 bit application “multiclutch”…

  22. Ben Throop

    August 28, 2009 at 10:32 pm / 

    And Jonas was about to go on vacation tomorrow… nooooo! ;(

  23. Tom Higgins

    August 28, 2009 at 7:26 pm / 

    @Askhan: and why don’t we avoid poking and prodding at OS-war comments here, m’kay? :) Neither Microsoft nor Apple are perfect, each has problems, each has benefits, use what suits you and go from there.

  24. Manfred Plagmann

    August 27, 2009 at 11:05 am / 

    Thanks for the heads up. The work around will work for me in the interim. All the best for coding the fix.
    Apple is not taking care of their developers of late.

  25. Aras Pranckevičius

    August 27, 2009 at 9:41 am / 

    @Ashkan: IE8+Vista fullscreen problem is not solved for Unity Web Player yet. Microsoft did not respond to our bug reports either. For 64 bit Windows users in general, there are no known problems – Unity editor, player and web player all work there just fine.

  26. Ashkan

    August 27, 2009 at 8:13 am / 

    @apple fans
    OSX with all of it’s strength is not as developer friendly as windows. IE8 was in beta for several months and many compatability articles are available to help you solve your site or plugin problems with the new browser altho it has a problem about something that unity can not be shown full screen there. is there any problem for windows 64bit users? i know there is not much win64 users.
    good luck

  27. Brady

    August 27, 2009 at 6:58 am / 

    And Apple wonders why they have such a smaller software base… They’re constantly pulling the rug out from under both developers and users.

  28. Christopher Romero

    August 26, 2009 at 3:54 pm / 

    Is Unity a registered Apple developer? This was not apparent in seed builds? Boo on Apple if so.

  29. Tadej

    August 26, 2009 at 3:15 pm / 

    Pretty crude on Apple’s part.
    Thanks for giving us a heads up and good luck with the 64-bit version.

  30. Martin Schultz, Decane

    August 26, 2009 at 3:00 pm / 

    Seems like Apple knows how to make friends with developers. Doh – what a hefty change and impact. Good luck on getting this fixed!

  31. Jonas Echterhoff

    August 26, 2009 at 2:27 pm / 

    @Francois: Please use our bug reporting tool for reporting any problems with Unity. We really cannot keep track of issues reported over all the other communication channels out there.

  32. Francois Roussel

    August 26, 2009 at 1:56 pm / 

    I also would like to take your attention on the fact that the FBX I/O plugin doesn’t work at all with cinema 4D when this one is used in 64 bit mode. A collada support would be more appropriate. Thanks a lot!

  33. Jashan Chittesh

    August 26, 2009 at 12:00 pm / 

    I think it’s kind of unfortunate that Apple rushed this in like that – but I think it’s cool that you do your best to stay on top of things (even if, for now, that means a bit of working around the issue for us). I really appreciate how you’re handling this situation … and good luck on the plugin-interface refactoring! It’s also nice to know that this at least has some advantages ;-)

Comments are closed.