You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
loadRemoteHLS never attaches the player layer to an already-bound surface (black video, audio plays) #120
Hit this while testing live IPTV channels through the nativeRemoteHLS path: video is completely black but audio plays fine, on every channel.
Looking at the flow, I think the bypass just never presents its layer. bind(view:) calls presentCurrentLayer() at bind time, and the normal load() native/software paths call it again after the host exists. But loadRemoteHLS sets self.nativeHost = host and early-returns before those calls — so if the surface was bound before load (the usual SwiftUI order: the view appears, then the load task fires), presentCurrentLayer() ran when nativeHost was still nil and nothing ever attaches host.playerLayer afterwards. AVPlayer happily plays audio without a layer, which makes it look like a codec problem when it's really just a missing attach.
Repro:
AetherPlayerSurface(engine:) on screen first (engine bound, nothing loaded).
load(url:options:) with isLive = true, nativeRemoteHLS = true and any live HLS URL.
Audio plays, view stays black. Same load with the surface created after load renders fine, since the fresh bind presents the by-then-existing host layer.
Suggested fix: call presentCurrentLayer() in loadRemoteHLS once the host is assigned (mirroring what loadNative does). I'm working around it host-side for now by re-creating the surface view after the load completes so a fresh bind runs, but that's a hack I'd love to delete.
For context: #119 is in the same nativeRemoteHLS path (headers dropped at asset creation). Separate fix, but worth looking at together if you're in that code anyway.
Confirmed, and your analysis was spot on. loadRemoteHLS assigned the host and early-returned without ever calling presentCurrentLayer(), so a surface bound before load ran the bind-time present while nativeHost was still nil and nothing attached the layer afterwards. Your SwiftUI ordering (view appears, then the load task fires) is exactly the sequence that hits it.
Fixed on main in c283b4c: presentCurrentLayer() now runs right after the host is assigned, mirroring what loadNative does. The attach is idempotent, so the post-bind and host-reuse cases are unchanged. There is also a unit test now that locks the pre-bound-surface contract (it reproduced your black-video case 1:1 before the fix).
You should be able to delete the surface-recreation workaround. Please give main a spin, and thanks for the precise report, both here and in #119.
Retested on 5.0.1, fixed. I deleted my surface-recreation workaround entirely, pointed the player at a live IPTV channel with the surface on screen before load (the exact ordering that black-screened), and video renders immediately, frames advancing. Nice touch adding the unit test for the pre-bound contract. Thanks for the fast turnaround, closing.
Activity
dlev02 commentedon Jul 10, 2026
For context: #119 is in the same
nativeRemoteHLSpath (headers dropped at asset creation). Separate fix, but worth looking at together if you're in that code anyway.fix(native): present the player layer in loadRemoteHLS for pre-bound …
Merge fix/issue120-remote-hls-layer-attach: present player layer for …
superuser404notfound commentedon Jul 10, 2026
Confirmed, and your analysis was spot on.
loadRemoteHLSassigned the host and early-returned without ever callingpresentCurrentLayer(), so a surface bound before load ran the bind-time present whilenativeHostwas still nil and nothing attached the layer afterwards. Your SwiftUI ordering (view appears, then the load task fires) is exactly the sequence that hits it.Fixed on main in c283b4c:
presentCurrentLayer()now runs right after the host is assigned, mirroring whatloadNativedoes. The attach is idempotent, so the post-bind and host-reuse cases are unchanged. There is also a unit test now that locks the pre-bound-surface contract (it reproduced your black-video case 1:1 before the fix).You should be able to delete the surface-recreation workaround. Please give main a spin, and thanks for the precise report, both here and in #119.
chore(release): 5.0.1
superuser404notfound commentedon Jul 10, 2026
Tagged and released: both this fix and #119 shipped in 5.0.1, so you can pin the release tag instead of main for the retest.
dlev02 commentedon Jul 10, 2026
Retested on 5.0.1, fixed. I deleted my surface-recreation workaround entirely, pointed the player at a live IPTV channel with the surface on screen before load (the exact ordering that black-screened), and video renders immediately, frames advancing. Nice touch adding the unit test for the pre-bound contract. Thanks for the fast turnaround, closing.