Categories & Tags
Archive

Snow Leopard’s 64-bit Safari and Unity

August 25, 2009 in Demos, Tutorials and Tips, Technology by

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.

Share this post

Comments (33)

Comments are closed.

26 Aug 2009, 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 ;-)

Francois Roussel
26 Aug 2009, 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!

Jonas Echterhoff
26 Aug 2009, 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.

26 Aug 2009, 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!

26 Aug 2009, 3:15 pm

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

26 Aug 2009, 3:54 pm

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

Brady
27 Aug 2009, 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.

Ashkan
27 Aug 2009, 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 Aug 2009, 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.

Manfred Plagmann
27 Aug 2009, 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.

28 Aug 2009, 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.

28 Aug 2009, 10:32 pm

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

Gavin
29 Aug 2009, 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”…

31 Aug 2009, 4:32 pm

Good luck for your strong effort ! Thank you.

Pirks
31 Aug 2009, 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.

1 Sep 2009, 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.

Chris
5 Oct 2009, 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.

5 Oct 2009, 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.

robert pfund
19 Oct 2009, 11:25 pm

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

Robert

20 Oct 2009, 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!

Mike
25 Oct 2009, 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.

31 Oct 2009, 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.

Conrad Winchester
6 Nov 2009, 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.

6 Nov 2009, 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.

9 Nov 2009, 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 .

fotis
12 Nov 2009, 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.

Coreyb
25 Nov 2009, 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.

smith8437
28 Nov 2009, 12:27 am

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

Ben
10 Dec 2009, 11:11 pm

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

Ben
11 Dec 2009, 2:15 am

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

rudolfwm
23 Feb 2010, 2:29 pm

Is this problem solved now?

leon yu
3 Jul 2010, 8:45 pm

how do you do this on a windows?

4 Jul 2010, 9:05 am

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

Leave a Reply

Comments are closed.