← HTX MediaPlayer contract & testing
How TVs get content, how to test end to end on two devices, and what browsers can't guarantee.
Test from two devices
- Publish the app, and use the published address on both devices (the editor preview can ask TVs to sign in to Lovable).
- Device A (laptop/phone): sign in at /auth. The first account created becomes the admin.
- Media → upload a JPEG and an MP4 (H.264/AAC). Approve both.
- Playlists → Houston Demo Loop → add both, set the image to 8 seconds → Publish to screens.
- Screens → Home Fire TV Test → Generate 15-minute code (or Create TV link and copy it).
- Device B (Fire TV, Silk browser): open /tv, type the code with the remote and press Connect. Or open the copied TV link directly.
- Press Start Playback for fullscreen. Press Enable Audio if you want sound. Any remote button brings the controls back.
- On Device A, reorder the playlist and publish again. Within ~20 seconds the TV switches once the current item finishes. The screen page shows last seen, now playing and errors.
- Press Revoke on Device A: the TV stops and asks for a new pairing code at its next check (~20s).
Browser limitations
- Sound needs a button press. Browsers only allow muted autoplay; audio starts after a remote press and may be blocked again after a reload.
- Fullscreen needs a button press and some TV browsers don't support it; the player keeps running in the window and says so.
- Offline is best effort, not guaranteed. The last playlist is saved on the device and media up to 150 MB per file is cached when the browser allows it. Browsers may clear this storage at any time, private windows usually don't keep it, and large videos stream instead.
- Video codecs: only H.264 video with AAC audio in MP4 is reliably supported on Fire TV Silk. HEVC/H.265 or other codecs may show black and get skipped.
- Sleep and screensavers: a web page can't stop Fire TV from sleeping. Set the TV's screensaver and sleep to "Never" in Fire TV settings.
- No auto-start on power-on. After the TV reboots, open Silk again; the pairing page offers "Resume saved screen".
- Logs are device reports only — "play_start" means the TV started an item; they are not audience or impression analytics.
Manifest contract (v1)
Designed so a future Roku BrightScript channel can use the same endpoints with roUrlTransfer + ParseJson.
GET /api/public/v1/manifest
Auth: Authorization: Bearer <device token> (or ?token=). 401 means the token is invalid or revoked — stop playback and show pairing.
{
"schema": "yalife.manifest.v1",
"screen": { "id": "8c1f…", "name": "Home Fire TV Test" },
"version": "22222222.4.k3j9a1",
"generated_at": "2026-12-03T15:20:00.000Z",
"url_expires_at": "2026-12-03T21:20:00.000Z",
"poll_interval_seconds": 20,
"heartbeat_interval_seconds": 30,
"items": [
{
"item_id": "b0e…", "media_id": "51a…",
"type": "image", "title": "Annie B's lunch special",
"url": "https://…signed…", "mime_type": "image/jpeg", "size_bytes": 482113,
"duration_seconds": 10, "play_to_end": false,
"start_at": null, "end_at": "2026-12-31T23:59:00.000Z"
},
{
"item_id": "c9d…", "media_id": "77f…",
"type": "video", "title": "Lard & Have Mercy promo",
"url": "https://…signed…", "mime_type": "video/mp4", "size_bytes": 18220311,
"duration_seconds": null, "play_to_end": true,
"start_at": null, "end_at": null
}
]
}- Play items in order and loop. Skip items outside [start_at, end_at) (UTC, null = open).
- Images show for duration_seconds; videos play to the end (play_to_end: true).
- Poll every poll_interval_seconds. When version changes, switch at the next item boundary.
- Media URLs are signed and expire at url_expires_at; refresh by polling. Cache files by media_id.
- On a media error, report it and skip to the next item. Empty items means show a house/demo slide.
POST /api/public/v1/heartbeat
Every heartbeat_interval_seconds. Updates last seen and stores events. Event types: startup, play_start, error, offline, online (max 100 per call).
POST /api/public/v1/heartbeat
Authorization: Bearer <device token>
Content-Type: application/json
{
"version": "22222222.4.k3j9a1",
"current_media_id": "77f…",
"user_agent": "Roku/DVP-12.5",
"events": [
{ "event": "play_start", "media_id": "77f…", "at": "2026-12-03T15:20:05Z" },
{ "event": "error", "media_id": "51a…", "message": "decode failed", "at": "2026-12-03T15:20:15Z" }
]
}POST /api/public/v1/pair
Body { "code": "K7M2QX" } → { "token": "…" }. Codes are single use and expire after 15 minutes. 404 = invalid or expired.
Deferred
Payments (Stripe), venue payouts, music licensing and a native Roku channel are out of scope for this MVP.