Search Unity

  1. 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

Bug [Regression][1188316] Webgl - VideoPlayer doesn't work on Android and Windows Chrome

Discussion in '2019.3 Beta' started by Kamyker, Sep 22, 2019.

  1. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    Vote up: https://issuetracker.unity3d.com/is...webgl-builds-when-the-video-is-loaded-via-url

    Hi, I've upgraded my project to unity 2019.3 (from 2019.2) as hdpi screens got fixed but unfortunately videos stopped working.

    Code (CSharp):
    1. WebGL: INVALID_VALUE: tex(Sub)Image2D: video visible size is empty
    I've tried both RenderTexture and Camera plane as VideoPlayer target. Loading video with url and starting to play it with prepareCompleted event.

    I've checked Windows and Android platforms.

    Happens on
    GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, v);
    in:
    Code (CSharp):
    1.         function _JS_Video_UpdateToTexture(video, tex) {
    2.             var v = videoInstances[video];
    3.             if (!(v.videoWidth > 0 && v.videoHeight > 0))
    4.                 return false;
    5.             if (v.lastUpdateTextureTime === v.currentTime)
    6.                 return false;
    7.             v.lastUpdateTextureTime = v.currentTime;
    8.             GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, true);
    9.             if (v.previousUploadedWidth != v.videoWidth || v.previousUploadedHeight != v.videoHeight) {
    10.                 GLctx.deleteTexture(GL.textures[tex]);
    11.                 var t = GLctx.createTexture();
    12.                 t.name = tex;
    13.                 GL.textures[tex] = t;
    14.                 GLctx.bindTexture(GLctx.TEXTURE_2D, t);
    15.                 GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_S, GLctx.CLAMP_TO_EDGE);
    16.                 GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_WRAP_T, GLctx.CLAMP_TO_EDGE);
    17.                 GLctx.texParameteri(GLctx.TEXTURE_2D, GLctx.TEXTURE_MIN_FILTER, GLctx.LINEAR);
    18.                 GLctx.texImage2D(GLctx.TEXTURE_2D, 0, GLctx.RGBA, GLctx.RGBA, GLctx.UNSIGNED_BYTE, v);
    19.                 v.previousUploadedWidth = v.videoWidth;
    20.                 v.previousUploadedHeight = v.videoHeight
    21.             } else {
    22.                 GLctx.bindTexture(GLctx.TEXTURE_2D, GL.textures[tex]);
    23.                 GLctx.texSubImage2D(GLctx.TEXTURE_2D, 0, 0, 0, GLctx.RGBA, GLctx.UNSIGNED_BYTE, v)
    24.             }
    25.             GLctx.pixelStorei(GLctx.UNPACK_FLIP_Y_WEBGL, false);
    26.             return true
    27.         }
     
    Last edited: Mar 15, 2020
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    5,154
    If you can reproduce this issue, please submit a bug-report as described in this document:
    https://unity3d.com/unity/qa/bug-reporting

    It's important that you report these issues together with a reproduction project if you want them to get fixed. If you don't do it, it might be a long time until someone else reports them or until Unity Technologies find them.

    After you submitted the bug-report, you receive a confirmation email with a bug-report Case number. Please post the Case number (number only, not the link) in this forum thread for Unity staff to pick up.
     
  3. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    Didn't receive the email., bug report is called the same as this thread

    Weird as I did receive email about other bug submitted a week ago
     
  4. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    Still in 2019.3.0b5, reuploaded bug report, case 1188316

    Edit
    Bug reproduced by Unity QA and sent to devs.
     
    Last edited: Oct 5, 2019
    WillPlus_Co and LeonhardP like this.
  5. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    7
    Any update of the issue? Been almost 6 months...
     
  6. GrimZard999

    GrimZard999

    Joined:
    Feb 17, 2020
    Posts:
    8
  7. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
  8. GrimZard999

    GrimZard999

    Joined:
    Feb 17, 2020
    Posts:
    8
    did downgrade work for you ? ill try it soon
     
  9. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    From what I remember it works fine in 2019.2 but there's another bug that makes screen blurry on high density screens (all mobiles) ;/
     
  10. MikeSz

    MikeSz

    Joined:
    Jul 7, 2014
    Posts:
    7
    Yeah, downgrade worked (actually the team is on 2019.3 and I'm working and building on 2019.2 - without any real issues...) but after the downgrade remote addressable assets in editor don't work properly and report being built by wrong unity version. However... they work in actual build without issues. Fortunately simulate mode works. Still - not fun
     
  11. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    2,193
  12. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
  13. MaskedMouse

    MaskedMouse

    Joined:
    Jul 8, 2014
    Posts:
    598
    This bug is keeping me from releasing a new important feature for our product.
    Using Unity 2019.3.7, going back to 2019.2.21 is not an option
    It seems to work on Edge
    It plays with stuttering on Firefox
    It doesn't render but does play audio on Chrome
    and I haven't tested Safari
     
    ismaelnascimentoash likes this.
  14. imbible

    imbible

    Joined:
    Apr 3, 2017
    Posts:
    2
    I encountered the same issue. It displays a black blank screen on Chrome. It works well on Edge and Firefox though.
     
  15. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    Update:
     
  16. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,031
    I've found forums reports of this being broken going back almost a year, and yet there's still no resolution.

    Is there at least a workaround that we can apply to our own projects?

    It appears to be something wrong in the JS Unity is generating - no other platform has this problem - can we at least do a search/replace on Unity web builds as a patch to be able to carry on developing while Unity waits to eventually patch it in their own code?
     
  17. ismaelnascimentoash

    ismaelnascimentoash

    Joined:
    Apr 2, 2017
    Posts:
    28
    On my case, just not works in the last version of Google Chrome.
    I tested with Unity 2019.3.13
     
  18. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,031
    I logged a bug against it > 2 weeks ago, still waiting to hear back. I believe the QA team hasn't even opened it yet, and the dev team that actually works on VideoPlayer won't see it until after the QA team has confirmed, so ... could be a long time yet.
     
    ismaelnascimentoash likes this.
  19. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    What? I recommend reading whole thread before commenting... I've reported it in beta 2019.3, no reason to duplicate.
     
  20. a436t4ataf

    a436t4ataf

    Joined:
    May 19, 2013
    Posts:
    1,031
    I was replying to the previous poster. I had already commented on this thread separately.

    It's great that a bug was logged last year, and hasn't been fixed, and nothing has happened, and there are no workarounds ... no, wait. It's a disaster. Unity has been sitting on this for a ridiculous amount of time. I'll keep encouraging people to report it until Unity either fixes it or gives some public explanaation of A) how much longer they plan to delay it and B) what they expect us to do in the meantime.
     
  21. ismaelnascimentoash

    ismaelnascimentoash

    Joined:
    Apr 2, 2017
    Posts:
    28
  22. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    Well then it seems that you still haven't read it.

    Agreed.

    Try google chrome or android device.
     
  23. ismaelnascimentoash

    ismaelnascimentoash

    Joined:
    Apr 2, 2017
    Posts:
    28
    Hello,

    Guys, on Unity 2019.2.10f1 the video works fine in Google Chrome and others browsers.

    Regards,
     
  24. Kamyker

    Kamyker

    Joined:
    May 14, 2013
    Posts:
    409
    Looks like fix will be added in 2020.1b9
     
    Last edited: May 15, 2020
  25. ismaelnascimentoash

    ismaelnascimentoash

    Joined:
    Apr 2, 2017
    Posts:
    28
unityunity