Click here to Skip to main content
15,912,665 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am developing a viewing station on which multiple users (many without computer experience) can watch video files. I'm not a programmer, so I'm using HTML/CSS, along with what JavaScript I can piece together, to open XSPF playlists in VLC Player 3.0.11 Vetinari on a Raspberry Pi 4 Model B running Raspbian 10. The browser these systems are using is Chromium 78.0.3904.108. I have encountered the following two roadblocks to completing this project.

Issue One: I need the HTML interface to open in a fullscreen viewport, on top of even the Debian taskbar. I imagine this can be done with JavaScript but have not been able to figure out how.

Issue Two: VLC Player is currently configured to play fullscreen whenever a user clicks a link in the HTML file, then close when either (1) the user clicks Stop or (2) the playlist ends, thereby returning the user to the HTML interface. There will be no keyboard hooked up to this Pi, so the mouse will offer the sole possible source of system access. Therefore, to limit users' potential mischief-making, I want to disable the menu that appears when a user right-clicks in VLC Player.

Any suggestion for a solution to either or both of these would be very much appreciated.

What I have tried:

Searching for solutions online but codes I found did not work.
Posted
Updated 16-Dec-20 22:08pm
Comments
Byron Case 19-Jan-21 12:07pm    
I finally devised a couple of ugly, inelegant solutions to these issues.

Firstly, the exit-fullscreen "X" button that drops from the topmost part of the screen in Chromium only appears once per browser session if you're using a dual-screen setup. I started the Raspberry Pi viewing station hooked up to a second monitor, positioned HDMI-1 on top, HDMI-2 on bottom. Next I shrank my taskbar to a width of 2 pixels, to keep users from monkeying around with anything they shouldn't. I opened my HTML page in the browser, hit F11 for fullscreen, moved my cursor around the top of the screen to summon the "X" button, then let it retract... never to return.

Unhooking the second display does let users lose their cursors beyond the top of the screen for a moment now and again, but they report being generally happy with the setup. Then only problem is the minor inconvenience of hooking up another monitor whenever the Pi reboots. We leave it on for a week or more at a stretch in the educational-resources area of the prison's recreation building. As for the issue of VLC's right-click menu, a little mouse surgery with a screwdriver and pliers neutered right-button functionality altogether.

I've heard a little about Pointer Lock API, which allows one to confine the cursor to a given window or onscreen area, but I haven't really done my homework on it. This might be the solution for future refinements. Of course, if anyone has potentially better solutions than the ones mentioned in this update, I always welcome suggestions.

You put a transparent "panel" over VLC, trap all mouse activity via event handlers on the panel, and send keyboard or automation commands to VLC.
 
Share this answer
 
Javascript has a fullscreen API:
Fullscreen API - Web APIs | MDN[^]

However, for security reasons, you cannot force your page to display full-screen. Any request to switch to full screen which is not in response to user interaction will automatically be blocked.

Once your page is in full-screen, the user will always have the option to exit.

Just imagine the carnage malicious sites could do if they could force their page to be full-screen as soon as you opened it, and prevent you from exiting!

If you have complete control of the system, you should instead use the command-line arguments to launch the browser in full-screen mode. For example, with Chrome you can use the --kiosk command-line argument:
Run chrome in fullscreen mode on Windows - Stack Overflow[^]

The simplest solution for VLC would probably be to create and apply a custom skin:
VLC media player - Skins - VideoLAN[^]
VLC media player - Skin Editor - VideoLAN[^]
 
Share this answer
 
I posted my update before having a chance to enter "chromium-browser --kiosk" in the Terminal window. I tried that afterward and produced exactly the response that I was looking for all along. At first glance it seems to also suppress right-clicking. I need to experiment a little more and find out whether or not this is the case. But thank you, Richard Deeming, for the perfect fix!

Now, to make the viewing station easier for admins to manage, I just have to create whatever the Linux equivalent of a batch file is. Opening Chromium with this argument by just clicking an icon on the Raspbian desktop will save them time and trouble.
 
Share this answer
 
Comments
Richard Deeming 22-Jan-21 4:30am    
... whatever the Linux equivalent of a batch file is ...
IIRC, that would be a shell / bash script:
Writing a Simple Bash Script - Linux.com[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900