libgdx/libgdx

GWT requests unnecessary microphone permission

Frosty-J opened this issue · 5 comments

Issue details

The SNAPSHOT build of libGDX appears to try to access the microphone for GWT. I am uncomfortable with releasing anything that requests microphone access unnecessarily.

1.12.1 on left; 1.12.2-SNAPSHOT on right. All that is different is gdxVersion:

Comparison screenshot

Reproduction steps/code

html:superDev

Version of libGDX and/or relevant dependencies

1.12.2-SNAPSHOT

Please select the affected platforms

  • Android
  • iOS
  • HTML/GWT
  • Windows
  • Linux
  • macOS

That's because of my PR #7243. The permission is needed to fetch the available output devices.

Could this behaviour be made optional? Such as by only performing the query when doing Gdx.audio.getAvailableOutputDevices() rather than each second.

It can be optional with a flag, but we can't do it in the method itself (at least I don't know how), because the JS API is async and the method is sync

Hmm, yeah, we'd either need developers to call the method multiple times (probably not a bad idea anyway since devices can change) or something in GwtApplicationConfiguration.

I don't think the SNAPSHOT behaviour should be the default, when most games are fine with using the default output device or letting the user choose via navigator.mediaDevices.selectAudioOutput() (just because microphone access is spooky - if it wasn't for that, I wouldn't care so much).

That's because of my PR #7243. The permission is needed to fetch the available output devices.

This should definitely not be made the default behaviour. Please consider a different solution.