feat(sia-video-source): iPhone MSE implementation support and device-too-old reporting - #1201
Merged
Merged
Conversation
…too-old reporting Adds an MSE implementation probe (mse-runtime.ts) that resolves the runtime MediaSource variant: standard, ManagedMediaSource (iPhone Safari 17.1+), legacy WebKitMediaSource prefix, or none. Managed runtimes construct an MMS in the worker when allowed, and the element gets disableRemotePlayback = true before every src/srcObject attach, as Safari requires for sourceopen. startstreaming/endstreaming forward as diagnostics. Runtimes with no usable MSE fail fast through a new device wire kind that maps to MEDIA_ERR_SRC_NOT_SUPPORTED with an update-your-device message on the v10 error channel. PlaybackCapabilities gains mseImpl() and mseSupported consults the resolved implementation. ADR 0010 documents the matrix.
This comment has been minimized.
This comment has been minimized.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
pcfreak30
marked this pull request as ready for review
September 24, 2026 21:32
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.
Adds
mse-runtime.ts, a probe that resolves the runtime MediaSource variant in preference order: standardMediaSource, thenManagedMediaSource(iPhone Safari 17.1+), then the legacy prefixedWebKitMediaSource, else none.Managed (MMS) runtimes now work end to end: worker-mode MSE constructs an MMS when
canConstructInDedicatedWorkerallows, and the element getsdisableRemotePlayback = truebefore everysrc/srcObjectattach — required orsourceopennever fires.startstreaming/endstreamingare wired as diagnostics only.Runtimes with no usable MSE (iPhone Safari pre-17.1, WebKit-prefix-only) fail fast with a new
devicewire kind that maps toMEDIA_ERR_SRC_NOT_SUPPORTEDwith an update-your-device message, surfaced through the existing v10 error getter/event.PlaybackCapabilitiesgainsmseImpl();mseSupported()now consults the resolved implementation. ADR 0010 documents the matrix and the non-goal of a legacy-prefix playback path.Overview
This PR adds iPhone Safari MSE support and introduces a dedicated
deviceerror for runtimes that cannot play Sia video at all.What changed
MSE implementation detection layer: New capability module resolves the runtime’s MSE surface in a fixed order — standard
MediaSource, thenManagedMediaSource, then legacyWebKitMediaSource, elsenone.MediaSourceis preferred when both standard and managed exist.ManagedMediaSourceis the only MSE available on iPhone Safari 17.1+ and is now used as a supported playback path.WebKitMediaSourceis detect-only and treated as “device too old”.none.New
deviceerror kind: Added to the wire protocol, error mapper, and host playback machine. It maps toMEDIA_ERR_SRC_NOT_SUPPORTED(4) with a message directing users to iOS 17.1+ or a recent desktop browser.Fail-fast device gating: Both the session coordinator and the host now reject loads with a
deviceerror (no-mse) before any worker roundtrip, source creation, or pipeline run when the runtime has no usable MSE.ManagedMediaSource element preparation: Before attaching any MSE source — including a worker-transferred handle — the host sets
disableRemotePlayback = true, which is required forManagedMediaSourceto firesourceopen.startstreaming/endstreamingevents are registered as diagnostics only.Consistent capability resolution: MIME support probing, worker-MSE capability detection, worker MediaSource construction, and host main-thread MediaSource construction all now use the resolved MSE implementation instead of referencing the raw
MediaSourceglobal. This lets MMS-only runtimes report real MIME support and enables worker-mode playback on runtimes whose managed constructor supports it.Tests, docs, and ADR: Added unit tests for MSE runtime detection/resolution, updated existing capability/session tests, documented the browser support matrix in the README, and added a decision record explaining the MSE implementation matrix and device-too-old handling.
Review finding
An automated review flags one issue: in
session-coordinator.ts, the device-too-old gate rejects only thenoneMSE implementation, sowebkit-legacyruntimes pass the gate and end up on the legacy detection path instead of reporting the intendeddeviceerror.