Search Unity

Question Why WebGL video player by URL is showing black screen on iOS devices?

Discussion in 'Audio & Video' started by nullgamestudio, Nov 8, 2022.

  1. nullgamestudio

    nullgamestudio

    Joined:
    Nov 6, 2016
    Posts:
    10
    Hello everyone, I hope that this is the right place to ask.
    I have some problems of black screen on iOS devices with a webGL app, meanwhile on android and desktop it just works.

    I find other similar threads saying it was fixed in 2020.3.x but it doesn't work for me.

    I am using unity 2021.3.2f.

    This is the test site: https://www.interactivelab.it/Work/WebTest/index.html

    I setup a simple scene with a button and a video player that load a video hosted on Digital Ocean. The video works well everywhere but it doesn't load on iOS devices like ipad and iphone, i see only a black screen.

    I read through the internet that can also be a CORS problem (which i setup on DO). Do you have any idea of what is wrong?
    Here the CORS settings.
    https://ibb.co/r0TdhCn

    Thank you in advance.
     
  2. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    Hi. What browser are you using? Are you experimenting the same issue with other browsers (ex. Firefox, Google Chrome, etc.)? Have you checked the player log for errors on your devices?
     
  3. nullgamestudio

    nullgamestudio

    Joined:
    Nov 6, 2016
    Posts:
    10
    Thank you for your response.
    No browser working at all on iOS devices ( tested Safari , Firefox and Chrome ).

    I checked che log on the Chrome browser in the IPad using the inspect tab and i see multiple lines of these WARNING :

    LOGWARNING: RGB Compressed DXT1|BC1 UNorm format is not supported, decompressing texture
    LOGWARNING: RGBA Compressed DXT5|BC3 UNorm format is not supported, decompressing texture


    and which i think it's the problem the following ERROR:

    ERRORwarning: 2 FS.syncfs operations in flight at once, probably just doing extra work

    EDIT:
    No warning or error at all on other platforms
     
  4. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
    And I am assuming if you paste your URL in your browser, it plays correctly?
     
  5. The_Island

    The_Island

    Unity Technologies

    Joined:
    Jun 1, 2021
    Posts:
    502
  6. nullgamestudio

    nullgamestudio

    Joined:
    Nov 6, 2016
    Posts:
    10
    Yes it works.

    Ok so for now there is no way to make video works on iOS devices? All the 3D stuff works pretty well.

    Thank you for the support anyway.
     
  7. K_Kuriyama

    K_Kuriyama

    Joined:
    Jul 4, 2020
    Posts:
    66
    @nullgamestudio s
    WebGL1.0 and Gamma will also work on iOS.
    If that does not work, try setting VideoPlayer to Mute.

    @The_Island
    Currently, the above settings seem to work.
    Is it possible to identify the cause of the problem and correct it?
    We are currently getting a lot of requests for WebGL on mobile devices, and need to have it supported on mobile devices as soon as possible.
     
  8. nullgamestudio

    nullgamestudio

    Joined:
    Nov 6, 2016
    Posts:
    10
    I tried with webGL1.0 but the performance on the 3D scene is drastically reduced on low end devices.
    In the previous versions I always switched to 1.0 for better FPS but now that it shows "Deprecated" we noticed that on some devices the automatic setup work better but always good to know that for the video it works! Thank you @Kazuki_Kuriyama

    I ended up switching between webgl and an HTML section in overlay with a div that contains the video and all the native controls, works perfect everywhere.
     
  9. K_Kuriyama

    K_Kuriyama

    Joined:
    Jul 4, 2020
    Posts:
    66
    Even 2.0 may work with gamma. You may want to try them too.