Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Webcam on Safari

Discussion in 'WebGL' started by MythicalCity, Aug 26, 2020.

  1. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    414
    I'm using the webcamtexture on webgl and it works great on Chrome, but on safari the camera doesn't show up and there's no request for the user to approve it like there is on Chrome. I've tried using https and also tried to request permission, but nothing shows up on Safari (this is on Mac, but also doesn't work on iOS devices). Anyone have any luck getting webcam to work on Safari?
     
    Last edited: Aug 27, 2020
  2. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    467
    @MythicalCity I already submitted a bug report on this issue, but I didn't get any feedback on the matter. In fact, the one time they replied to a bug report of mine regarding a mobile WebGL problem, they said they don't support mobile WebGL but they would take a look lol. They just don't care, at least that's my impression. Try submitting a bug report, maybe you will have better luck.
     
  3. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    414
    Thanks! can you post a link to your bug report, then I can upvote it.

    I think part of the issue is Safari being more locked down and not supporting a lot of webgl features, but there should still be some documentation or clarity on workarounds or how to achieve this as obviously lots of web services use webcams on Safari without any problem, so I imagine that Unity should support it too.
     
  4. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    467
    Regarding the safari bug, they didn't create an issue on the issue tracker as far as I know. But there is this bug.

    I also created this thread to bring attention to another bug. I created a bug report for it as well. But nothing on the issue tracker as of yet =/.
     
    Last edited: Sep 1, 2020
  5. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    99
  6. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    467
    This issue has been tracked now, for a while. If you guys can vote on it, maybe it will get fixed faster. Call your friends, family, dog and neighborhood to vote on this lol.
     
  7. jukka_j

    jukka_j

    Unity Technologies

    Joined:
    May 4, 2018
    Posts:
    827
    @Bersaelor Can you try checking out Unity 2021.1.0b4? I rewrote the camera handling backend there, that should help out iOS camera usage.

    Note that you will need to host the page on a secure https:// protocol, or browsers will not allow camera access.

    If that does not work, check out the browser console logs for diagnostic messages.
     
    metasota likes this.
  8. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    99
    Hey there, I just tried with 2021.2.0a5(alpha) and Safari did finally prompt the camera. Let me also try the latest beta version (still need to download it).
    For links to the demos see the other thread.
     
    Last edited: Feb 25, 2021
  9. bobluoluo

    bobluoluo

    Joined:
    Jan 9, 2020
    Posts:
    1
    Webcam is broken on IOS. windows, android are fine. 2021.3 LTS
     
  10. Bersaelor

    Bersaelor

    Joined:
    Oct 8, 2016
    Posts:
    99
    Yeah, I tested it recently too,
    So, Safari (regardless of whether on iOS or macOS) seems to use different camera-permission code and the `allow access to camera` has not been working for a while for me.
    As discussed above @jukka_j has fixed it and the fix is in 2021.2.0alpha builds, tested it myself on https://test.looc.io/forest/index.html (the fix is not available in 2020.3 LTS nor 2021.1.0f1, try https://test.looc.io/forest21/index.html )
     
  11. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    467