Platform
Supported Smart TV platforms and streaming devices.LG Smart TVs running webOS.
Samsung Smart TVs running Tizen OS.
Hisense Smart TVs running VIDAA OS.
Smart TVs running WhaleOS (Whale browser-based platform).
Amazon Fire TV and Fire TV Stick devices.
Roku streaming devices and Roku TVs.
Microsoft Xbox consoles.
Sony PlayStation consoles (PS4, PS5).
Android TV devices including Google TV, Chromecast, and various TV manufacturers.
Vizio SmartCast TVs.
Fallback for unknown or standard web platforms.
KeyAction
Remote control and gamepad key actions.PlatformKeyMap
Mapping of platform-specific key codes to normalized key actions.Example
PlatformCapabilities
Device capability flags for feature detection.Whether
navigator.sendBeacon() API is supported for analytics.Whether
fetch() with keepalive option is supported.Whether autoplay requires the video to be muted (browser policy).
Whether fullscreen API is supported.
Whether hardware video decode capabilities can be queried.
Whether HDR (High Dynamic Range) video is supported.
Whether HDR10+ is supported.
Whether Dolby Vision HDR is supported.
Whether Dolby Atmos audio is supported.
Whether HEVC/H.265 video codec is supported.
Whether VP9 video codec is supported.
Whether AV1 video codec is supported.
Maximum supported video resolution.
Whether the device has touch input support.
Whether the device has voice control capabilities.
DeviceInfo
Detailed device information.Device model identifier (e.g., “OLED55C1PUB” for LG C1).
Device manufacturer (e.g., “LG”, “Samsung”, “Amazon”).
Operating system version.
Device firmware version.
Screen width in pixels.
Screen height in pixels.
Device pixel ratio (e.g.,
1 for 1080p, 2 for 4K on 1080p logical screen).IPlatformAdapter
Platform adapter interface for device abstraction.Current detected platform.
Platform capabilities. See PlatformCapabilities.
Device information. See DeviceInfo.
Normalize a raw key code to a KeyAction.Parameters:
keyCode- Raw keyboard/remote key code from KeyboardEvent
- Normalized KeyAction or
nullif unmapped
Get platform-specific key codes for a given action.Parameters:
action- The key action to look up
- Array of key codes that map to this action
Check if a specific codec is supported on this platform.Parameters:
codec- MIME type with codec (e.g.,video/mp4; codecs="hvc1")
trueif codec is supported,falseotherwise
Open an external link in a new tab/window using platform-specific method.Parameters:
url- The URL to open
Example
DEFAULT_KEY_CODES
Default key code mappings for all supported platforms.Example Structure
Platform-Specific Key Codes
WebOS Key Codes
WebOS Key Codes
461- Back button (WebOS-specific)415- Play19- Pause413- Stop417- Fast Forward412- Rewind457- Info403-406- Color buttons (Red, Green, Yellow, Blue)
Tizen Key Codes
Tizen Key Codes
10009- Back button (Tizen-specific)10252- Play/Pause toggle427-428- Channel Up/Down447-448- Volume Up/Down449- Mute
Fire TV Key Codes
Fire TV Key Codes
4- Android back button85- Play/Pause126- Play127- Pause89- Rewind90- Fast Forward82- Menu
Xbox Key Codes
Xbox Key Codes
13- A button (Enter)27- B button (Back)195- Menu button196- View button
PlayStation Key Codes
PlayStation Key Codes
13- X button (Enter)27- Circle button (Back)- D-pad:
37-40(Left, Up, Right, Down)
PLATFORM_DETECTION_PATTERNS
Regex patterns for detecting platforms from User-Agent strings.navigator.userAgent. Maps Platform enum values to arrays of RegExp patterns.
Example Structure
Detection Patterns by Platform
/Tizen/i/SMART-TV.*Samsung/i
/Web0S/i/WebOS/i/LG.*NetCast/i/LGE.*TV/i
/Vidaa/i/VIDAA/i/Hisense/i
/WhaleTV/i/Whale/i
/AFT/i- Amazon Fire TV/AFTS/i- Fire TV Stick/AFTM/i- Fire TV models/Amazon.*Fire/i
/Roku/i
/Xbox/i/Edge.*Xbox/i
/PlayStation/i/PS4/i/PS5/i
/Android.*TV/i/Chromecast/i/BRAVIA/i- Sony TVs/SHIELD/i- NVIDIA Shield
/VIZIO/i/SmartCast/i
Empty array - fallback for all other platforms
