Repository navigation
Report HLS playback health for viewers who never join an SFU - #1448
Open
ipavlidakis wants to merge 11 commits into
Open
ipavlidakis wants to merge 11 commits into
ipavlidakis wants to merge 11 commits into
Conversation
ipavlidakis
marked this pull request as draft
November 19, 2026 17:56
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Generated by 🚫 Danger |
|
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 23, 2026 12:52
9ba0017 to
71d5adc
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 24, 2026 08:18
71d5adc to
fa14609
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 25, 2026 11:40
fa14609 to
0e12056
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 25, 2026 11:44
0e12056 to
fa14609
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
2 times, most recently
from
November 25, 2026 13:48
672ae45 to
1a3b30a
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 25, 2026 14:14
1a3b30a to
bde2d99
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 25, 2026 17:12
bde2d99 to
5e693d2
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 25, 2026 19:37
5e693d2 to
b79adb3
Compare
This was referenced Nov 25, 2026
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 26, 2026 11:48
2dc46e5 to
a7d8fbe
Compare
4 of 7 tasks
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 26, 2026 13:32
a7d8fbe to
bb2a602
Compare
ipavlidakis
marked this pull request as ready for review
November 26, 2026 15:50
6 of 7 tasks
martinmitrevski
approved these changes
Nov 26, 2026
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
5 times, most recently
from
November 27, 2026 14:51
2a7704a to
27cef76
Compare
ipavlidakis
force-pushed
the
ipavlidakis/IOS-2235-hls-telemetry
branch
from
November 27, 2026 16:53
27cef76 to
fd530c2
Compare
SDK Size
|
StreamVideo XCSize
Show 48 more objects
|
StreamVideoSwiftUI XCSize
Show 6 more objects
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



🔗 Issue Links
🎯 Goal
An HLS viewer never connects to an SFU, so the WebRTC stats path stays empty. Without HLS stats, a bad HLS session does not show in call stats.
📝 Summary
started, periodicstats, andendedreports toPOST /video/call/{type}/{id}/hls_stats. Every report hasstats_tokenandunified_session_id.unified_session_id, so the backend can match the reports to the session.stats_options.enable_hls_statsisfalseor the join has noplayback.stats_token.reporting_hls_interval_ms, elsereporting_interval_ms, else 10 s. It is kept between 1 s and 60 s.startedgoes out on the first play.endedgoes out only afterstarted, with the final stats and the events not yet sent.AVPlayerItemFailedToPlayToEndTimeare recorded as errors.endedthen has theerrorreason with that code.🛠 Implementation
The behaviour matches Android
HlsStatsReporterandHlsStatsCollectorin #1917.HLSStatsCollectorwatches oneAVPlayer. A serial queue applies the KVO changes in order, with the time captured in each callback. A snapshot hands its stats and events to the reporter on that queue, sostop()cannot sendendedbefore them.HLSStatsReportersends one report at a time through the generatedreportHLSStatsendpoint.startedandendedretry, with the sharedRetryPolicy.HLSStatsAdapterruns the interval timer and connects the collector and the reporter.CallStatecomputes one internal value (token and interval) from the join response.HLSStateAdaptercreates the stats adapter when it creates a player, and starts it in aTask.free()mutes the player, reads the final stats, and then stops the player. A swap and.webRTCgo throughfree(). Creating the player does not wait for the network.ended.endedcarriesend_reason: erroranderror_codeonly for a terminal error. That is when the player gives up after 10 reloads, or when it stops without ever playing after it recorded an error. Ifstartedwas not sent yet, the SDK sends it first, so the backend creates the participant. A hang with no player error useserror_code: load_timeout(to confirm with the backend team).end_reason: left.startedevents.startedcarries no events. Buffered events go with the nextstatsorended.🎨 Showcase
No UI change.
🧪 Manual Testing Notes
Needs a call type with HLS enabled for viewers, a running HLS egress, and a backend with the
hls_statsendpoint.LivestreamPlayer.startedreport, at least onestatsreport, and anendedreport with reasonleft.A backend without the endpoint rejects the reports. Playback continues.
☑️ Contributor Checklist