CastCustomData

Builds the Bunny receiver's LoadRequest customData: Widevine DRM configuration plus embed theming, mirroring what the web sender ships. The receiver validates every value and falls back to its defaults for anything missing, so fields are simply omitted when not configured.

Kept as pure Map-building (JSON conversion at the edge) so the contract is unit-testable without Android's org.json stubs.

Functions

Link copied to clipboard
fun build(playerSettings: PlayerSettings?, drmLicenseUrl: String?): Map<String, Any>
Link copied to clipboard
fun colorToCss(color: Int): String?

Android AARRGGBB color int → CSS hex (#rrggbb, or #rrggbbaa when the color is translucent). Fully transparent colors mean "not configured" (e.g. the zeroed fallback PlayerSettings) and are omitted.

Link copied to clipboard