Search Unity

WebGL video support! Need so bad it hurts!

Discussion in 'Web' started by kob123, May 29, 2015.

  1. kob123

    kob123

    Joined:
    Aug 20, 2014
    Posts:
    5
    We've made an interactive music video with Unity and it just would be sooooooooooooo much f*cking better if it would be possible to distribute via WebGL!

    The unity webplayer is cool and all but having to download and install the plugin is such a huge difference for new users vs WebGL obviously.

    Basically we've made this interactive music video using greenscreen technologies for real life characters that we filmed, incorporated into the animated world (VR as well). The desktop mac/windows versions are something we're really proud of, and after many trials and tribulations, we've even managed to get an awesome version fully working via unity webplayer, which is something we read many times was not possible (for alpha video), including from the developers of the videotexture plugins we purchased.

    So we're pretty much ready to launch this thing and have people either torrent/download the desktop version or play the unity webplayer version (after installing the damn plugin) but I thought I'd through this out to the community first - is there anyone anywhere who's found/created/can create any solution for playing a video via WebGL at all??? Yes I am also going to add that it needs to be alpha but we found a very unique workaround for the alpha computation for the webplayer version and I'm thinking the same technique can be applied to the WebGL solution, if the video texture can be played in the first place.

    Very interested in any comments so thanks in advance!

    Cheers
     
  2. crushforth

    crushforth

    Joined:
    Jul 22, 2010
    Posts:
    113
    There is a workaround for playing videos in WebGL. You essentially play the videos in javascript as hidden videos on the page and you copy the contents of the video into your unity Texture2D each frame. The results are surprisingly good.

    I think I used a modified version of this https://github.com/jtothebell/UnityStreamingMovieTexture. I think Jonas here did the first proof of concept versions.
     
  3. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    As @crushforth wrote, it is pretty easy to embed html5 video in WebGL content. The results are actually considerably better than Unity's built-in Video solution, so we currently have no plans to make that available to WebGL in the near future (and also, because the current audio solution used in Unity WebGL would not allow our video code to hook into, so video would be silent).