voc / voctoweb

voctoweb – the frontend and backend software behind media.ccc.de
GNU General Public License v3.0
188 stars 55 forks source link

Bug: Full screen video player uncaught exit from fullscreen mode #737

Open unknowndomain opened 8 months ago

unknowndomain commented 8 months ago

Most web browsers support Escape and some kind of OSD to exit fullscreen mode to prevent malicious developers hijacking the users computer.

When you do this, the video player remains in fullscreen mode from a CSS local styles and class perspective, which means you still have to press the exit fullscreen mode.

Steps to reproduce:

  1. Play a video
  2. Enter fullscreen by any means
  3. Press escape

Note the video is still filling the viewport, rather than returning to a inline box in the page.

You'll also note the video still has mejs__container-fullscreen and some custom local styles for size.

Solution

Not being familiar with the stack, it's a bit tricky; it looks like you could solve this in a hacky way by monitoring for escape and exiting fullscreen when you do that, but it wouldn't catch the OSD or other browser-triggered exits. You could probably monitor for an event for exiting fullscreen mode, but again this probably isn't the issue.

For some reason MediaElement.js isn't detecting this event, but if you look at examples of the code on their website it works fine, so I'd imagine the bug is either:

  1. In the specific version of MediaElement.js being used.
  2. A bug that involves code interacting between MediaElement.js and custom code for voc/voctoweb.

Test system details: