Search Unity

  1. Click here to see what's on sale for the "Best of Super Sale" on the Asset Store
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

[DISCONTINUED] uWebKit - Chromium WebView for Unity 5

Discussion in 'Assets and Asset Store' started by uWebKit.com, Aug 1, 2013.

  1. diese440

    diese440

    Joined:
    May 25, 2007
    Posts:
    105
    Hi Josh,

    is [view].AlphaMask available in uWebkit2 beta ?
     
  2. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @diese440: Yes, this will be in the next beta release.

    Cheers,
    - Josh
     
  3. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    26
    Hi Josh, in a past message, you wrote to Madhur: "You will need to use alpha masking, please check out the ExampleAlphaMask.unity scene and see if this will work for you." I'd like to have a look at this as well but not sure where to find it, i couldn't locate it in the unity package or on github. Maybe you can give me some direction here, sorry if this is a newb question...

    I would like to mask out parts of a webpage, ignoring areas and only showing regions of interest. I've been able to prototype by simply adding black quads in front of the content I don't want to see, brute forceably hiding that unwanted stuff. Ideally, i'd like to use an alpha. adding a transparent/diffuse material doesn't seem to have an affect. this is what I got right now:



    the 2 columns on the right are facebook and twitter. the black space in between is covered up by black quads.

    any direction would be appreciated. thanks. looks like your support here has been stellar, it's great to see.
     
    Last edited: Aug 6, 2014
  4. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    26
    another question... how would I force a reload of web content on an event? I was looking into Material.SetTexture to accomplish this but my guess is that has more overhead than necessary. I need content to update when an RFID card is swiped. Thanks again.
     
  5. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello AlpayKasal,

    AlphaMasking will be in the next uWebKit2 beta, which will be available soon. Does LoadURL on the view not reload the view for you?

    Edit: I made a ticket to add a Reload method to the WebView to make it easier to reload the current URL

    - Josh
    http://www.uWebKit.com
     
    Last edited: Aug 6, 2014
  6. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    There is a new uWebKit2 Beta build available on the GitHub page:

    https://github.com/uWebKit/uWebKit/wiki/Getting-Started-with-uWebKit-2.0

    There is now a UWKWebView.SetAlphaMask(bool enabled) method which can be used to enable alpha masked rendering of a view. Make sure to have background-color: transparent in your CSS and an AlphaMask cutout material applied. There is an example included which shows using the alpha mask feature.

    There is also now a UWKWebView.Reload() method which will reload the current content.

    - Josh
    http://www.uWebKit.com
     
  7. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    26
    Ah brilliant... will try it now. and sorry for asking a question that I now notice has come up, in regards to alpha channels. I'll jumpon that now. thanks so much for the assist.
     
  8. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    26
    Question related to the Alphamask, I saw how it works in the example, makes sense... however, I can't see how I would use a png resource within unity to cutout using an alpha. I don't have the ability to inject my own CSS when accessing a page like facebook, so I'd like to use a pre-made png with alpha to control what portion of the web page is seen. is this possible? Thanks again.
     
  9. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello AlpayKasal,

    You can specify user css in this file: StreamingAssets/uWebKit/Data/uwebkit.css

    Let me know if this works when setting background to transparent for you. I am not sure on the setting of the alpha channel in the Texture2D, right now this is blitted in C++ for speed. The best option would seem to be to set the transparent CSS if possible.

    - Josh
     
  10. AlpayKasal

    AlpayKasal

    Joined:
    Aug 4, 2014
    Posts:
    26
    I couldn't really force this to make it do what i wanted :/ but i have a question about a different tact, it's about offsetting the texture. I started with a a UWK texture of 1024x1024 and a scale of the gameobject of 1,1,1. ok, that's standard. Now, if i set the X of the web texture to 512, and scale the gameobject on X to .5 i get what you'd expect, correct proportions on the web texture on a plane that is now half the width... so, can I programatically offset the web texture? then I can use the texture scaling, object scaling, and offset all together to get the view I need. possible?

    I was playing with http://docs.unity3d.com/ScriptReference/Material.SetTextureOffset.html but i failed. do you think this could be a solution for me? i likely failed out of newbness, i hope there is an easy YES to my questions. Thanks again for everything.
     
  11. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello all,

    We're very pleased to have uWebKit2 running in the full 64 bit Unity5 beta editor. Unity5 will be fully supported by uWebKit2




    @AlpayKasal: The uWebKit texture is a standard Texture2D. We want to add some API for setting the texture size based on the content size (right now the texture is created to max size for performance, but when mapping in 3D based on changing content size, it is nice to not have to fiddle with UV). I am not sure what the use case is...

    - Josh
    uWebKit2 on GitHub
     
    Last edited: Aug 23, 2014
  12. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  13. unity1_igd

    unity1_igd

    Joined:
    Sep 15, 2014
    Posts:
    7
    Hi, i am currently working with your WebKit. I have build a scene which uses like 60 Webtextures to show some information. I need to adjust them to the actual size of the HTML content dynamically. SetCurrentsize() of UWKWebView is not sufficent for that purpose, because the actual Texture2D keeps its size. I've tried to resize the Texture manually but this has led to a crash of Unity. The only solution i've found so far is to destroy and rebuild the WebView, but its too slow if you do that with that number of Webtextures.
    Do you have an idea what i could try instead of this and elaborate on that?

    Kind regards
     
  14. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    60 simultaneous web textures is an extreme number of webviews to create. I would recommend against this, especially if they are all visible. If at all possible, I would keep the number of views under 10 and manage the views in a way that is consumable by the user. The web texture currently keeps its size for performance reasons, can you adjust the UV of your 3D geometry?

    - Josh
    http://www.uwebkit.com
     
  15. dcarrigg

    dcarrigg

    Joined:
    May 21, 2014
    Posts:
    24
    Does uWebKit support HTML5 video?

    I've downloaded the beta, and tried playing various html5 videos through the Web Browser example, but none of them seem to work.
     
  16. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  17. dcarrigg

    dcarrigg

    Joined:
    May 21, 2014
    Posts:
    24
    Just tested that out, and it works great. Is anything extra required for OSx?

    Also, are can we control the user-agent?

    Thanks.
     
  18. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    OSX includes the codecs so they are not required.

    I have added a ticket to the allow specifying of the user agent: https://github.com/uWebKit/uWebKit/issues/94

    We should be able to get to this soon, very good feature request.

    We also have an update coming soon which provides enhancements to Direct3D11 rendering with shared GPU textures between Unity and the web rendering process as well as framerate controls per webview.

    - Josh
    http://www.uwebkit.com
     
  19. schneidross

    schneidross

    Joined:
    Sep 17, 2014
    Posts:
    8
    Hi Josh,

    I recentliy started using uWebKit and was wondering if there is a way to attach a webView on surfaces which are not flat but some kind of curved? Especially I would like to know how I can achieve to get uWebKit working with imported .obj 3D models. Initially it looks like it's working but it happens that links on webpages are not clickable on objects of such kind (imported ones).

    Any help would be much appreciated. Thanks in advance.
     
  20. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  21. schneidross

    schneidross

    Joined:
    Sep 17, 2014
    Posts:
    8
    Hi Josh,

    thanks for your reply. I loaded the example you were talking about and tried to log some debug information. Unfortunately, this does not work at all. After adding some lines like

    Code (CSharp):
    1. Debug.Log ("test");
    within both functions
    Code (CSharp):
    1. void Start () {}
    and
    Code (CSharp):
    1. void Update () {}
    (in the WebTexture.cs file (which is attached to the sample's Plane "WebTexture")), I am not able to find the debug message in the Editor.log file which I was able to find in c:\users\myName\AppData\Local\Unity\Editor.

    Since my license expired a couple of days ago, I am not able to check whether the debug messages would be printed in the unity editor's console or not (since I am not allowed to use the unity built-in preview player anymore (by pressing the play button)).

    Do you have any suggestions? Any help would be very much appreciated.

    Best
     
  22. schneidross

    schneidross

    Joined:
    Sep 17, 2014
    Posts:
    8
    Hey there,

    I found out what the logging-related problem was. I was simply looking for the wrong log file, sorry. Now I'm back on trying to get the clicking issues fixed and will report as soon as there are some news.

    Thank you.
     
  23. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @schneidross uWebKit2 is now out of beta, however as you have been working with it, I have sent you a direct message with some additional information.

    - Josh
    http://www.uwebkit.com
     
  24. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  25. unity1_igd

    unity1_igd

    Joined:
    Sep 15, 2014
    Posts:
    7
    Hey Josh,

    i'm using several WebTextures. Is there a way to abort the loading process of a htmlpage? Seems like all requests i make are in some kind of queue and are processed successively. So when i load a html page the loading must be finished before i can load another page.
     
    Last edited: Oct 2, 2014
  26. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello, there isn't currently API to cancel a page load, however I have added an issue to add it:

    https://github.com/uWebKit/uWebKit/issues/110

    When I click on tabs in the example browser, I don't see a stack behavior (ie. it doesn't queue up pages). However, it can take a second to switch pages if there is currently a page loading.

    - Josh
    http://www.uwebkit.com
     
  27. unity1_igd

    unity1_igd

    Joined:
    Sep 15, 2014
    Posts:
    7
    Let me elaborate on that. I have a model of a factory hall with 30 machines. Every machine has a little detailswindow where information like pressure or energy usage is shown. These informations are html pages(on my HDD) and i use your webkit to display them.
    Since there are so many webtextures i use a method to stop the rendering process. Its basically the hide() method without changing the visible attribute. This method is called in the loadfinished() delegate handler. Sometimes there is a delay until the loadfinished message for one view arrives and all the other views are queued. To make it more clear what i mean:

    view1.loadfinished() //t=1
    view2.loadfinished() // t=2
    <---- 8 seconds delay
    view3. loadfinished()//t=10
    view4. loadfinished()//t=11
    view5. loadfinisehd()//t=12

    So some views are waiting for one view to get the message. In this case its not a problem, but if i change the url of all views before every view has completely finished loading, some html pages are not loaded properly and still show the old page. This sometimes lead to a timeout and a kill message is send by UWKCore if i remember it correctly. Furthermore i get messages with contentsizes of the former URL and it takes ages before everything has loaded like it should be. On the other Hand it works perfectly fine if i change the URL after every view has loaded completely.
    So a function which aborts everything which is going on in the background so it's like the loading has completely finished would be desirable.
     
  28. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @unity1_igd: Are you using uWebKit2, if not and at all possible, I would recommend upgrading. It is a free upgrade for uWebKit1 users and has many improvements in the core tech. The WebView component is quite similar:

    https://github.com/uWebKit/uWebKit/blob/master/uWebKit/Assets/uWebKit/UWKWebView.cs

    You can always download the latest version of uWebKit2 here: http://uwebkit.com/download

    I have a ticket to add the cancel loading feature, this will go into uWebKit2 soon.

    - Josh
    http://www.uwebkit.com
     
  29. rl_is

    rl_is

    Joined:
    Feb 11, 2013
    Posts:
    2
    Hi Josh - just a quick question about using uWebKit2 on cross-platform products. Our app compiles to Windows, Mac, iPad and Webplayer, so we wrap uWebKit (and another 3rd party library for iOS) with our own code, and for WebPlayer just open websites in a new tab.

    The only problem with Webplayer is that I have had to do a couple of compile fixes within the uWebKit codebase. All I've done is wrap
    #if !UNITY_WEBPLAYER around the Directory.Delete call in UWKDeploySupport.cs and File.ReadAllText in UWKPlugin.cs. Would it be possible to wrap some (or all) of uWebKit in the most appropriate defines?
     
  30. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @rl_is It sounds like you may be using a build from the beta period. The release version has the deployment support #if guarded for the WebPlayer build. You can download the latest version here: http://uwebkit.com/download

    If you did purchase during the beta period, contact sales@uwebkit.com to receive your activation key.

    I have added a ticket to fix the WebPlayer compilation issue with ReadAllText and look into #if guarding all of uWebKit2: https://github.com/uWebKit/uWebKit/issues/111

    I don't think there is a standard way of doing this, though it is a good idea. We can probably stub out the view component so there aren't missing component warnings on other platforms.

    - Josh
    http://www.uwebkit.com
     
  31. wmaass88

    wmaass88

    Joined:
    Dec 23, 2012
    Posts:
    43
    Hi,

    Very useful asset. One thing I noticed is that you can't set the quality of YouTube videos. To test, run the webbrowser sample and go to YT play any video and try to set the playback quality with the player controls. I noticed this while attempting to create a custom YT video application. Is this a known limitation or something that can be resolved?
     
  32. rl_is

    rl_is

    Joined:
    Feb 11, 2013
    Posts:
    2
    Thanks Josh - am downloading the latest version now!
    I just have our wrapper class add the view component dynamically for standalones but the stub seems as though it would be more elegant from a uWebKit point of view. Cheers for the fast reply!
     
  33. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    uWebKit 2.0p2 is now available from the download page:

    http://uwebkit.com/download

    + Added WebView.Stop() method for canceling an in progress page load
    + Javascript alert and confirm now output to console as they were opening top level windows
    + Added define guard for WebPlayer build

    @wmaass88: On Windows, uWebKit uses WebM video as this format is free of patent and license restrictions. Unfortunately, on YouTube in order to get higher than 360p WebM, Media Source Extensions also has to be supported. I don't have an ETA of when this will be added. On OSX, this YouTube limitation does not exist.

    - Josh
    http://www.uwebkit.com
     
    Last edited: Oct 10, 2014
  34. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    Hi there, as a recent purchaser, loving this plugin!
    Quick questions from a code-illiterate dev, though one who can get access to programmers:
    We'd love to be able to integrate the web viewer into our Unity 4.6 (open beta) GUI. Is support for this in the pipeline?
    Also, is it possible to do alpha html5 transparancy with the Webgui, and not just the Webtexture?

    Sorry if these are silly questions, or have been asked before.

    Thanks!
     
  35. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    Hello,

    Yes, you can use alpha transparency with the WebGUI. You need to use view.SetAlphaMask(true); and also make sure transparency is set in your css, see StreamingAssets/uWebKit/Examples/AlphaMaskExample.html for an example of this... here is a shot of a transparent WebGUI:



    We do plan on creating an example script for use with the new Unity GUI system soon.

    - Josh
    http://www.uwebkit.com
     
  36. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    "I’m right now at a point, where most things I want achieve work well, except one issue, where I struggle.

    I have 5 smaller WebGUIs floating around with different urls. If a click one, another bigger view will appear in the center. But this one shall stay in z order on top of the others. But if behaves the other way around.

    I played with z-position and ordered layers without any effect. Is there any trick to get it going? do I need a certain renderer for ordered layers?"

    Hello, have you tried using the GUI.depth?

    http://docs.unity3d.com/ScriptReference/GUI-depth.html

    - Josh
    http://www.uwebkit.com
     
  37. Etrain

    Etrain

    Joined:
    Nov 3, 2013
    Posts:
    11
    Hi,
    We're unable to display Flash content using the latest webkit, Unity 4.6b20 on Windows 7 64bit. It simply doesn't show.

    Is Flash still supported?
     
    Last edited: Oct 15, 2014
  38. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @Etrain: We are dropping support for the Flash plugin as it has stability and rendering issues we are unable to address.

    - Josh
    http://www.uwebkit.com
     
  39. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    Hello,
    Just letting you know we had an issue where, when the game was paused, we were unable to communicate javascript between a webpage and the game. We traced the issue back to the update method uWebKit uses in its core. Once we changed the update method to unscaledDeltaTime, we were able to pause the game and still communicate between the webkit and unity. If there are no drawbacks to this method, it would be good to see this minor change added to the next build.

    Thanks!
     
  40. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
  41. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    Great, I've recently learnt though that this class was introduced in 4.5, and might produce an error on earlier versions of Unity. So while it's good for me, it could be an issue for others.

    Also, I submitted a bug report on github regarding HTML5 audio crashes. This is particularly pressing issue for us. Have you been able to reproduce the issue?

    https://github.com/uWebKit/uWebKit/issues/115
     
  42. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @Anderz: Thanks for letting us know about the 4.5 API requirement. WebAudio is still problematic for the web in general, what format are you using? Are you having this issue on Windows or OSX, 32 or 64 bit deployment?

    Thanks,
    - Josh
    http://www.uwebkit.com
     
  43. Anderz

    Anderz

    Joined:
    Dec 5, 2013
    Posts:
    24
    Happy to help!

    We're using the standard MP3 and ogg, but the web process crashes as soon as we try reloading the web page after playing audio.

    To give you some context, we're actually launching local Adobe Captivate 8 HTML5 projects with embedded audio for our training sims, cutting from the game to the captivate module using your webkit. It mostly works fine, aside from the audio issue.
     
  44. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @Anderz

    This sounds like a really great use of uWebKit. I have a fix for the audio tag issue which will be in the next binary release which will be available soon.

    - Josh
    http://www.uwebkit.com
     
  45. schneidross

    schneidross

    Joined:
    Sep 17, 2014
    Posts:
    8
    Hello Josh,

    as you might remember, I am using uWebKit as textures on curved surfaces and in the meantime, I managed to fix most of the problems I had. But there is one issue remaining: When I load a project of one of my colleagues, which is basically a 2D WebGL application, I end up in having only up to 4-5 fps. Running the same application in my default browser (google chrome), I always get around 30 fps. Is there a known performance problem with WebGL? Is there a way to speed it up?

    Thank you.

    Andreas
     
  46. unity1_igd

    unity1_igd

    Joined:
    Sep 15, 2014
    Posts:
    7
    Hey,

    i adjust the size of my webtextures with the help of the UMSG_VIEW_CONTENTSIZECHANGED message type. However there is a gap in time between the beginning of loading the page and the arriving of this type of message(takes 4 seconds in avarage).
    What i need is an identifier in the message which tells me to which URL this message belongs to, so when i change the URL in these 4 seconds and then get the message i can tell if its for the current URL or the one i had before.

    You have those iparams[] and fparams[] but i couldnt find values in these which are always the same with a given URL. I could do a counter which increases for every URL change and decreases for every message arrival, so i can discard messages which are obsolete, but i'm looking for a more "clean" solution.

    Greetings

    Marc
     
  47. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @schneidross: The current uWebKit doesn't support WebGL (as you are seeing from the framerate). We're looking into updating to Chromium for uWebKit 2.1, which may provide better WebGL support.

    @unity1_igd: I have added an issue to add more information to the content size changed delegate: https://github.com/uWebKit/uWebKit/issues/119

    uWebKit 2.0p3 has been released. It features a WebInspector, proxy support, Google WOFF Font support, and a fix for the audio tag on Windows, and other enhancements.

    Download the uWebKit 2.0p3 Unity package here: http://www.uwebkit.com/download



    - Josh
    http://www.uwebkit.com
     
  48. swinginbird

    swinginbird

    Joined:
    Feb 11, 2014
    Posts:
    1
    Hi Josh, thank you.

    I was wondering if uWebKit really does not support webGL at all? Because if I visit http://doesmybrowsersupportwebgl.com/ with uWebKit to check for webGL support, it states that it actually does ("experimentally"); see attached file.

    Besides that, can you roughly estimate when you will release Version 2.1?

    Best
     

    Attached Files:

  49. uWebKit.com

    uWebKit.com

    Joined:
    Feb 16, 2013
    Posts:
    119
    @swinginbird: There is experimental WebGL support, however it is slow as you are experiencing. We are working with Chromium to see if we can provide all the uWebKit features with it. Especially the tight Javascript integration and IME support. If we can get these features working, we'll switch the backend to it. We have to provide a smooth upgrade from 2.0 to 2.1. I don't have a estimate on 2.1 at the moment.

    - Josh
    http://www.uwebkit.com
     
  50. ArenAK

    ArenAK

    Joined:
    Oct 30, 2014
    Posts:
    5
    Does uwebkit support the resolution of 4096*768? The version1.4 does not allow me to set this resolution. Is there a version that supports such a high resolution?
     
unityunity