diff --git a/config/sway/config b/config/sway/config index 7c9771b..e8a0897 100644 --- a/config/sway/config +++ b/config/sway/config @@ -19,6 +19,11 @@ exec --no-startup-id /usr/local/bin/classroom-dock include /etc/sway/config.d/* +# The DVD player is an appliance screen, not a desktop window: no sway +# title bar, and it opens fullscreen over the dock. +for_window [class="(?i)vlc"] border none +for_window [app_id="(?i)vlc"] border none + # Minimize and restore. # # classroom-window parks the window on a hidden workspace as an ordinary diff --git a/docs/dvd.md b/docs/dvd.md index 737f38d..53cfb5d 100644 --- a/docs/dvd.md +++ b/docs/dvd.md @@ -39,32 +39,79 @@ a disc left in over the week does not announce itself at every boot. ## Playback Playback is VLC, chosen over mpv because mpv dropped DVD menu support. -VLC's `dvdnav` path gives working menus, chapters and audio tracks. +VLC's `dvdnav` module is what provides the disc menus, and `dvd://` +selects it. `classroom-dvd toggle` hands the disc to VLC through `classroom-window`, so the DVD player behaves like any other classroom application: the DVD button focuses it, minimises it, and restores it. `Super+M` minimises it too. VLC starts fullscreen; `Esc` leaves fullscreen. +## How VLC is made to fit the classroom + +Stock VLC looks like a desktop media player, which is wrong for a room +where the TV is the whole interface. It is dressed down with documented +VLC 3.x options — no skin is involved, because skins replace the +interface wholesale and take DVD menu input with them: + +| Option | Why | +| --- | --- | +| `--fullscreen` | The disc opens straight onto the TV | +| `--qt-minimal-view` | No menu bar or extended panels | +| `--qt-dark-palette` | Dark window instead of the default light grey | +| `--no-qt-bgcone` | No orange cone, no album-art panel | +| `--no-qt-system-tray` | Not a background desktop application | +| `--no-qt-name-in-title` | Nothing in the title bar to read | +| `--no-qt-video-autoresize` | The window does not jump to the video size | +| `--qt-notification=0` | No now-playing popups | +| `--qt-continue=0` | Never asks to resume where it left off | +| `--no-qt-recentplay` | No history of the discs a classroom has played | +| `--no-qt-privacy-ask` | No first-run privacy dialog | +| `--no-video-title-show` | No title banner over the video | + +sway also draws no border on the VLC window +(`for_window [class="(?i)vlc"] border none`), so there is no title bar +above the video either. + +The auto-hiding fullscreen controller is deliberately **kept**. It is +the only way to pause or change chapter with a mouse, it is not +persistent chrome, and a volunteer with a wireless mouse needs it. + +`--intf dummy` would give an even barer window, but the dummy interface +takes the keyboard and mouse handling that DVD menu navigation depends +on, so it is not an option here. + +Note that `--no-qt-updates-notif`, which earlier classroom builds +passed, is not an option in Debian's VLC at all — it made VLC exit +before it started. + ## Commercial (CSS encrypted) discs Most retail DVDs are CSS encrypted, and Debian cannot ship the decryption library. Unencrypted discs — curriculum discs, home-burned video — play without any extra work. -For commercial discs, run once per endpoint, as root: +**This is automatic.** On any classroom with `DVD_ENABLED=true`, the +provisioning service installs the codecs after the next boot. See +[provisioning.md](provisioning.md). + +To do it by hand, or to watch it happen: ``` sudo classroom-dvd-css-setup +classroom-dvd-css-setup --status ``` -That enables the Debian `contrib` component, installs `libdvd-pkg` and -builds `libdvdcss`. It needs network access and it compiles a package, -which is why it is deliberately not run from the package `postinst`: the -postinst runs while dpkg already holds the apt lock during an OTA update. +It enables the Debian `contrib` component in whichever APT source format +the machine uses, installs `libdvd-pkg`, answers its debconf questions +and builds `libdvdcss`. It only ever adds a missing component to an +existing Debian entry, so repeated runs cannot produce a duplicate +repository or a duplicate component, and third-party repositories such +as Google Chrome's are never touched. -**Commercial DVD playback has not been verified on hardware yet.** Test -with an actual disc before relying on it for a service. +It needs the network and it compiles a package, which is why it runs +from the provisioning service rather than the package `postinst`: the +postinst executes while dpkg is still holding the apt lock. ## Command line diff --git a/docs/testing.md b/docs/testing.md index 1e6225c..7aee7dc 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -111,6 +111,9 @@ With `DVD_ENABLED=true`: - [ ] Closing the player works - [ ] Ejecting is detected, the icon goes back - [ ] Reinserting is detected again +- [ ] VLC opens fullscreen, dark, with no menu bar, no orange cone and + no sway title bar +- [ ] The fullscreen controller still appears on mouse movement - [ ] Commercial CSS disc, after `classroom-dvd-css-setup` ## OTA diff --git a/scripts/classroom-dvd b/scripts/classroom-dvd index ec604f4..4a38f41 100755 --- a/scripts/classroom-dvd +++ b/scripts/classroom-dvd @@ -43,12 +43,42 @@ def notify(title, message, urgency="normal"): def player_command(device): + """VLC, dressed down to look like an appliance rather than a desktop app. + + All of these are documented VLC 3.x options, verified against the + 3.0.23 build in Debian Trixie. No skin is involved: skins replace the + interface wholesale and break DVD menu input, which is the one thing + that has to keep working. + + Note that --no-qt-updates-notif, which earlier builds passed, is not + an option in Debian's VLC and made it refuse to start at all. + """ return [ PLAYER, + # Fullscreen first: the disc opens straight onto the TV. "--fullscreen", - "--no-video-title-show", + # No menu bar or extended panels, and a dark window instead of + # the default light grey one. + "--qt-minimal-view", + "--qt-dark-palette", + # No orange cone, and no album-art panel, behind the video. + "--no-qt-bgcone", + # Nothing that behaves like a desktop application. + "--no-qt-system-tray", + "--no-qt-name-in-title", + "--no-qt-video-autoresize", + "--qt-notification=0", + # Never offer to resume, and never accumulate a list of the + # discs a classroom has played. + "--qt-continue=0", + "--no-qt-recentplay", + # No first-run privacy dialog, no title banner over the video. "--no-qt-privacy-ask", - "--no-qt-updates-notif", + "--no-video-title-show", + # dvd:// selects VLC's dvdnav module, which is what provides the + # disc menus. The Qt interface is kept for exactly that reason: + # --intf dummy would be cleaner still but takes the keyboard and + # mouse handling that menu navigation depends on with it. f"dvd://{device}", ]