- Home /
Unity Web Player - Bypass Call Home for "fully offline" functionality
Hey everyone!
So I'm fairly new to Unity, but I've managed to make a simple game that I'm decently proud of and I want to get my friends in my CompSci class to critique it. Instead of trying to hand out or post a regular Windows or Mac build, I thought "why not build it for Web Player?" Well here's why not: at our school, unity3d.com is restricted, which means that the required version check in UnityObject2.js can't finish, so the game never runs. It starts, sure, but it always returns an AutoUpdate error.
So my question is this: is it possible to host all of the required Unity Web Player components on the same website as the game so that no communication with unity3d.com is necessary? Or maybe I should just delete the version check from UnityObject2.js so the game can start regardless?
Any help is appreciated!
It's a web player EULA requirement that the components are installed from the Unity servers. If your school/college/university want to have the web player installed offline, then they can contact the sales $$anonymous$$m to discuss a license.
Ahhhh okay, thank you for pointing that out! They won't want to pay for it so we'll just have to build it for Windows or $$anonymous$$ac respectively and then provide it for download on a cloud like Google Drive. Does that work out okay legally?
I didn't say it had to be paid for... If your friends have access to Unity editor, then the machine they use should already have the web player installed on it - it's part of the editor install. You should then be able to make an offline web player build, which writes the UnityObject2.js, html and unity3d files to the hard drive. That should be viewable without needing a web player install. Or tell them to view your game on their home computers, where they do have access to the unity site.
Answer by Bunny83 · Nov 13, 2014 at 12:28 AM
This is actually a duplicate of
http://answers.unity3d.com/questions/389934/unity3d-offline-streaming-on-web-player.html
Usually it's not possible, but as you can see in the answers to that question with a lot of manual copying it seems to work. Note that the answer is quite old. It's possible that it doesn't work anymore with the newest version of Unity.
Also keep in mind that things compiled with Unity beta won't work either, probably because there's no webplayer for beta available. At least it didn't work when i tried the last time ;)
Answer by jenkstrojan44 · Nov 13, 2014 at 02:33 PM
Okay, so I finally got it working! I don't know if anyone will have the same problem, but just in case, here's what I did:
Open the UnityObject2.js file.
Locate the "var a" definition about line 904.
There's is a subset "definition" (a.archive, line 907) that references unity3d.com. Open a web browser and type in baseDomain + baseDownloadURL + "3.0/jws/UnityWebPlayer.jar" (the full URL would be "http://webplayer.unity3d.com/download_webplayer-3.x/3.0/jws/UnityWebPlayer.jar"). Download that file.
Change that reference in the UnityObject2.js file to just "UnityWebPlayer.jar" because you'll just upload it to your website in the same directory as the UnityObject2.js file.
Repeat the same procedure for "var p" (p.jnlp_href) on line 919, making sure to upload the .jnlp file to your website and change the reference in the UnityObject2.js file.
Also in the var p definition there is an image "unitylogo.png" that is also referenced. You don't need this, but to be sure I'd also download it and perform the same procedure as for var a and p.
To my knowledge, those are the only three times in the Offline Build that reference outside sources. Download those for offline access and you're golden!