• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
Question by DaveA · Oct 11, 2011 at 11:59 PM · webplayer

Can I use gzip with webplayer and www?

I've seen several posts here and on the forums about this. What I want to do is be able to decompress a gzipped file using the web player. I understand I might be able to cobble together some DLL's that would work in the Editor and/or standalone builds. Not what I need. Web Player. .Net (even 2.0) supports a gzip class, but it does not work as-is (ver 3.4). Because .Net supports gzip 'natively' nobody seems to have any c# sources I might be able to drop into my project.

So, can I use these other DLL's (managed or otherwise) in a web player build if I put them in my Plugins folder? Are there any sources out there that I could compile into my project so I don't have to rely on external DLL's? or assemblies? Or do I have to go to gzip.org and translate the C code there to C#? Will Unity ever support zipping with ease? Thanks in advance.

Comment

People who like this

0 Show 0
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

  • Sort: 
avatar image
Best Answer

Answer by DaveA · Oct 12, 2011 at 09:46 PM

Here's what works for me, also in Indie and Web Player: Get DotNetZip library, extract Iconic.Zip to Assets/Plugins, use 'using using Ionic.Zlib;' and then simply:

 byte[] decompressed = Ionic.Zlib.GZipStream.UncompressBuffer(www.bytes);
 xmlText = System.Text.ASCIIEncoding.ASCII.GetString(decompressed);
Comment
Pica
Bunny83

People who like this

2 Show 3 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image j-millen · Jul 06, 2014 at 02:46 PM 0
Share

I would like to use this, but I am not a Windows or .NET programmer, so I don't know where to put the two code lines. There is no mention of "xmlText" in the html generated for the Webplayer version of the project. Do I need to modify the source of the Webplayer or the ionic dll?

My problem is the same: the hosting service will not accept the unity3d file type, and refuses to add it. Zipped files are OK, but the Webplayer can't use them...

avatar image mgear · May 27, 2016 at 04:01 AM 0
Share

here's one place for the dll, if cannot find elsewhere (copy to your plugins folder) https://github.com/Parms80/UnityFighter2D/blob/master/Assets/X-UniTMX/Ionic.Zlib.dll

avatar image Bunny83 mgear · May 27, 2016 at 04:19 AM 0
Share

You can not find it elsewhere? Have you tried it on the actual project website? ^^

avatar image

Answer by Bunny83 · Oct 12, 2011 at 12:28 AM

As long as a dll uses pure managed code it can be used like any scripts you wrote. Just put it into your assets folder and you should be able to use it. Even in the webplayer as long as the assembly doesn't use blocked / restricted namespaces / methods like System.IO.

I don't really was in need of a zip library, but i've come across ICSharpCode.SharpZipLib.dll which supports gzip as far as i remember.

Comment

People who like this

0 Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image DaveA · Oct 12, 2011 at 06:39 AM 0
Share

So, System.IO would not be usable in the assembly? Then as long as the compressor / decompressor operates on memory buffers, it should be ok, true?

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

Why can't I build Web Player in Unity while I have no problems with building standalone versions? 2 Answers

embed web player without javascript 1 Answer

Question about webplayer 1 Answer

Web Player crashes in Pause Menu 1 Answer

Custom dll on web player 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges