Conversation
SCORM packages containing audio/video (mp3/mp4) fail to play in mobile Safari. SCORMRenderer._serve_file streamed the whole file with a 200 and no Accept-Ranges / 206 handling, and iOS Safari requires HTTP range requests to play <audio>/<video>. Desktop Chrome tolerates a 200, which is why this only surfaced on iPhone. Make the response range-aware via Response.make_conditional so range requests get 206 + Content-Range; non-range requests still get 200 and now advertise Accept-Ranges. This also enables media seeking everywhere. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- Use 100dvh instead of 100vh for the SCORM iframe. 100vh is unreliable on mobile browsers across toolbar/orientation changes and mis-sizes the player. - Mobile browsers (notably iOS Safari) blank the SCORM iframe on orientation change and do not repaint added DOM until a full reload, so in-page recovery UI cannot help. Reload the page on orientationchange; existing resume support restores the learner's position. A short delay lets the debounced suspend_data save flush first. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
I don't think the frontend part (viewport class + rotation handler) is ready. Mind splitting this into two PRs so the range fix doesn't have to wait on that discussion? A few things to sort out first:
One more small thing on the backend side: while you're in And last thing — any chance of adding a test for the 206 and 416 cases? The renderer is reachable from the test suite, so it should just be a matter of encoding the two scenarios from the table above. Not blocking, just would be nice to have. |
|
Closing due to inactivity, please reopen with requested changes |
Summary
Three fixes for SCORM chapter playback on mobile browsers, found while testing an Articulate Storyline (SCORM 1.2) package on iOS Safari and Android Chrome. On desktop everything worked; the issues were mobile-specific.
1. SCORM media doesn't play on iOS Safari — HTTP Range support
SCORMRenderer._serve_filestreamed the whole file with200and noAccept-Ranges/206handling. iOS Safari requires HTTP range requests to play<audio>/<video>, so allmp3/mp4in a package were silent/blank on iPhone (desktop Chrome tolerates a200, which is why it only showed on mobile).Fix: make the response range-aware via
Response.make_conditional(...). Range requests now return206+Content-Range; non-range requests still return200and advertiseAccept-Ranges. Also enables media seeking.2. Player mis-sized on mobile —
100vh→100dvh100vhis unreliable on mobile across toolbar/orientation changes. Switched the SCORM iframe to100dvh.3. SCORM iframe blanks on rotation
On orientation change, mobile browsers blank the SCORM iframe and (on iOS) do not repaint newly-added DOM until a full reload — so in-page recovery UI (overlay/button) never paints. Recover by reloading on
orientationchange; existing resume support restores the learner's position. A short delay lets the debouncedsuspend_datasave flush first.Testing
Verified on a self-hosted v15 bench with a SCORM 1.2 package containing mp3/mp4:
206with correctContent-Range; non-range200withAccept-Ranges.🤖 Generated with Claude Code