Skip to content

feat(ui): show HLS livestreams in the livestream UI - #1795

Draft
renefloor wants to merge 4 commits into
feat/hls-web-playerfrom
feat/hls-ui
Draft

renefloor wants to merge 4 commits into
feat/hls-web-playerfrom
feat/hls-ui

Conversation

@renefloor

Copy link
Copy Markdown
Contributor

🎯 Goal

Step 7 of HLS_PLAN.md (FLU-1266): the livestream UI shows a call the backend sent to HLS instead of reporting "the host's video is not available". Stacked on #1794.

🛠 Implementation details

  • New LivestreamPlayer parameters:
    • enableHlsPlayback is passed to its own join. It asserts that an hlsVideoBuilder is set.

    • hlsVideoBuilder builds the HLS video. LivestreamContent takes the same builder.

    • stream_video_flutter does not depend on stream_video_hls. An app passes:

      hlsVideoBuilder: (context, p) => StreamHlsVideoRenderer(call: p.call, videoFit: p.videoFit),
  • The builder receives LivestreamHlsVideoProperties (call, videoFit), so videoFit and fullscreenVideoFit apply to HLS. StreamHlsVideoRenderer takes a VideoFit and resolves adaptive with resolveVideoFit, which is now public.
  • LivestreamContent checks playbackType before looking for hosts. On HLS it shows the new LivestreamHlsContent while connected:
    • the video;
    • a spinner while loading or buffering;
    • a play icon while paused;
    • tap to pause, and tap again to resume at the live edge;
    • a "could not be played" card when playback fails, with the back button still there;
    • on web, a card with a "Tap to play" button that calls resumeWebAudioPlayback() while the browser blocks autoplay.
  • LivestreamPlayer now listens for a double tap only when allowDiagnostics is on, so single taps are no longer delayed by the double-tap timeout.
  • The speaker toggle mutes the HLS player through the playout pause (step 2). The viewer count comes from the coordinator.
  • New strings in en and nl.
  • Picture in picture for HLS follows in step 8.

🎨 UI Changes

New golden livestream_hls_content covers the playing, paused, failed and blocked states, in light and dark. The CI PNGs come from the update_goldens run on this branch.

🧪 Testing

  • flutter test test/src/livestream test/src/renderer --exclude-tags golden passes. It covers:
    • the join flag;
    • the switch between the HLS and WebRTC branches;
    • the connection states;
    • the overlays and their priority;
    • tap to pause and tap to play;
    • the video fit;
    • right-to-left layout.
  • lobby_controller_test "disposes the device controller with itself" fails locally on Flutter 3.50.1. Nothing in this stack touches that code.

🤖 Generated with Claude Code

@github-actions github-actions Bot added the v2 label Dec 4, 2026
@getstream-metis

Copy link
Copy Markdown

👋 Hi Rene, still cooking? 🍳

I'm Jeffery, Stream's review agent. I look for bugs, regressions, missing tests and slow paths, and I only post findings I've checked against the code.

📝 This PR is a draft, so I'll keep my hands off for now. Mark it Ready for review and a ✅ box to start my review shows up right here.

Can't wait? Comment /jeffery review now and I'll start the moment it's ready. I'll stay quiet unless you ask.

renefloor and others added 4 commits December 5, 2026 10:58
`LivestreamPlayer` gains `enableHlsPlayback`, which it passes to its join,
and `hlsVideoBuilder`, which `LivestreamContent` also takes. On HLS,
`LivestreamContent` shows `LivestreamHlsContent` instead of the hosts, so an
HLS join no longer reports the host as missing. stream_video_flutter does not
depend on stream_video_hls: apps pass a builder returning
`StreamHlsVideoRenderer`.

`LivestreamHlsContent` shows the video with a spinner while it loads or
buffers, a play icon while paused, tap to pause and resume at the live edge,
a message when playback failed, and on web a tap-to-play button while the
browser's autoplay policy blocks it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The HLS video builder takes `LivestreamHlsVideoProperties` with the call
  and the video fit, so the player's `videoFit` and `fullscreenVideoFit`
  reach the HLS video; `StreamHlsVideoRenderer` takes a `VideoFit` and
  resolves `adaptive` with `resolveVideoFit`, which is now public.
- `LivestreamPlayer` listens for a double tap only while it allows the
  diagnostics, so tap to pause is not held back for the double-tap
  timeout.
- `LivestreamPlayer` asserts an HLS video builder with
  `enableHlsPlayback`, and the HLS content logs when it has none.
- The tap-to-play card explains why it asks for a tap, the play icon is
  drawn light over the video, and the audio controller is read only when
  the button is tapped.

Adds tests for the join flag, the switch between HLS and WebRTC, the
connection states, tap to play and right to left, and a golden of the HLS
states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant