m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.96k stars 449 forks source link

Mouse/keyboard capture doesn't work when Autoplay is blocked in Firefox #250

Closed tatsumara closed 1 year ago

tatsumara commented 1 year ago

When connecting with a Firefox client that has the Autoplay permission blocked, the browser window isn't able to capture/be controlled with keyboard and mouse. As far as I can tell, the relevant console log is the following:

[NEKO] ERR DOMException: The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.

I haven't tried if this is an issue on other browsers too. It might be a good idea to communicate this to the user, as it caused me a bit of a headache (:

m1k1o commented 1 year ago

By default, only muted autoplay is enabled. That's what we are doing. There is icon with speaker and a overlay, when that is clicked autio is unmuted:

image

If all types of autoplay are disabled, there should be a big play button shown with overlay, when clicking on it ti should start playing:

image

Are those icons not showing for you?

tatsumara commented 1 year ago

the second one does indeed not show up, but the first one does when the permission is granted!

tatsumara commented 1 year ago

to get back to this, playing does indeed work without issues, but even with the permission fully denied only the first icon shows, and mouse/keyboard input doesn't work.

m1k1o commented 1 year ago

Looks like internal state about when video is playing is wrongly set to true, if autoplay is disabled. When you press down on pause and then again on play, it starts working.