/* ScreenTinker — Tizen capability declaration. * * The dashboard used to offer every control to every display, so buttons a platform cannot honour * did nothing and read as bugs. The player now DECLARES what it can actually do * (server/lib/player-capabilities.js holds the vocabulary) and the frontend hides the rest. * * Declared at RUNTIME rather than from a static table, because on Tizen the answer genuinely * varies by build and panel: * - reboot and real panel power exist only through webapis.systemcontrol / b2bapis.b2bcontrol, * which are injected ONLY on a Samsung panel running a .wgt signed with a Partner distributor * certificate. The same code on an unsigned dev build, the URL-Launcher path, or a consumer TV * has no such surface (see device-control.js). * - tizen.tvaudiocontrol is a TV-profile API; it is absent in a plain browser context. * A hardcoded list would claim these on every Tizen device and be wrong on most of them. * * ⚠️ Names must match server/lib/player-capabilities.js exactly. An unknown string is DROPPED by the * server's parser, so a typo silently removes a control rather than failing loudly. */ (function () { 'use strict'; /* Native TV audio. Present on the TV profile; absent in a browser/URL-Launcher context, which is * why this is probed rather than assumed. */ function tvAudio() { return (window.tizen && tizen.tvaudiocontrol && typeof tizen.tvaudiocontrol.setVolume === 'function') ? tizen.tvaudiocontrol : null; } /* The Samsung fleet-control surface, via the module that already owns those probes. Re-asked on * every call because the platform can inject these objects after the first script pass. */ function fleet() { try { return window.STDeviceControl ? window.STDeviceControl.capabilities() : null; } catch (e) { return null; } } function detect() { var caps = [ // Playback surface — all implemented in player.js on every Tizen build. 'playback.video', 'playback.image', 'playback.widget', 'playback.youtube', 'playback.zones', 'playback.transitions', 'playback.pip', // Per-item mute, honouring the shared rule in server/lib/media-mute.js (including the // YouTube embed, which used to be hardcoded muted and unmutable). 'audio.mute', // Volume always resolves to SOMETHING: the native TV control where the profile provides it, // otherwise the media elements. Both change what a viewer hears, so the control is honest. 'audio.volume', // CSS for graphics, and AVPlay's setDisplayRotation for portrait/flipped video — the Tizen // HTML5