kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Bloom books' audio and video don't play on release-v0.20.x: files of 500 KB or more, and all narration on Chromium 91 and older

Open rtibblesbot opened this issue 1 week ago • 3 comments

❌ This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues.

Target branch: release-v0.20.x

Observed behavior

  • kolibri-zip gives BloomRunner an absolute …/zipcontent/<file>/<path> URL for every audio or video entry of 500 KB or more (BloomRunner.js:108-113).
  • Bloom Player's fullUrl (bloomPlayer-02a77592459cdf0b1bd7.min.js, line 116) prefixes every src that does not start with blob: with the book's blob URL. A video's src becomes blob:http://<host>/<book id>/http://<host>/content/zipcontent/<file>/video/a.mp4.
  • BloomRunner writes each narration id and data-backgroundaudio as _<last URL segment> (BloomRunner.js:30-40). The player's narration lookup and currentMusicUrl rebuild that as blob:http://<host>/<segment>, so audio/music.mp3 becomes blob:http://<host>/music.mp3.
  • On Chromium 91 and older (Android WebView 83), every page turn throws Uncaught TypeError: c(...).split(...).at is not a function. The narration lookup and currentMusicUrl call Array.prototype.at (Chromium 92+), and the bundle has no polyfill.
  • Local books and a peer's books are both affected.
  • v0.19.4 and v0.19.5 ship the same player bundle and the same runner code.
  • #15039 (closed) fixed this on develop only: its player build carries 0003-Pass-URLs-that-carry-a-scheme-through-fullUrl.patch and 0006-Play-audio-from-URLs-the-book-already-resolved.patch.

User-facing consequences

A learner sees a blank video and hears no narration or background music wherever the file is 500 KB or more. On Chromium 91 and older, no narration or background music plays, whatever the file size.

Steps to reproduce

  1. Import a Bloom book with a video of 500 KB or more, such as a sign-language book.
  2. Open the book in Learn and go to the video's page.
  3. Inspect the page's <video> or <source>: its src is the blob:…/http://… URL above, and the network tab shows no request to zipcontent/<file>.bloompub/video/….

On Chromium 91 and older:

  1. Install a release-v0.20.x Android build on an Android 11 emulator (WebView 83).
  2. Import the Bloom folder of the Kolibri QA Channel (token nakav-mafak) and open "Стаза од давнина" in Learn > Library > Kolibri QA Channel > Bloom > bloompub.
  3. Turn a page with adb logcat chromium:I *:S running: the at is not a function error is logged.

Context

  • release-v0.20.x at b19ef0f009.
  • The 0.20 bundle is built from learningequality/bloom-player's patched branch (README).
  • Fix by backporting develop's in-tree Bloom Player build: de380cef09, 24a7deaca7, 9c8cbc2db4, fedca7ca29, fb535babaf, e5782c4b65, 7832c1ea96.
  • Copying develop's bundle alone does not work: it reads data-audio-src and data-original-href from the book, which only develop's BloomRunner.js writes.
  • Keep release-v0.20.x's peer URLs (zipcontentArchiveUrl, zipcontentEntryUrl) in BloomRunner.js. Develop's runner does not use them.
  • Develop's build polyfills Array.prototype.at with core-js.

Acceptance Criteria

  • [ ] release-v0.20.x builds Bloom Player from bloom_build/ as develop does.
  • [ ] On release-v0.20.x, a Bloom book's video of 500 KB or more plays, requested from zipcontent/<file>/<path>.
  • [ ] Narration and background audio of 500 KB or more play, requested from zipcontent/<file>/<path>.
  • [ ] Audio and video under 500 KB still play from their blob URLs.
  • [ ] A peer's book requests the same files from zipcontent/<encoded peer>/<file>/<path>.
  • [ ] Tests cover a large video src, a large narration file and a large data-backgroundaudio file.
  • [ ] On Chromium 80–91 (Android WebView 83), paging a Bloom book from first to last page logs no at is not a function error.
  • [ ] On the same browser, a Bloom book's narration plays.

AI usage

Claude Code drafted this from a self-review finding on the branch for #15970. It ran the shipped bundle's fullUrl and currentMusicUrl on local and peer zipcontent URLs to get the URLs quoted above. I chose the backport and folded #16029 into this issue.

rtibblesbot avatar Nov 25 '26 03:11 rtibblesbot

Chose the fix: backport develop's in-tree Bloom Player build. Develop's bundle can't be copied over by itself because it depends on develop's runner. Dropped the #15970 condition from the criteria now that it's closed.

rtibbles avatar Nov 26 '26 03:11 rtibbles

Folded in #16029: the backported build's core-js polyfill also fixes Array.prototype.at on Chromium 91 and older. Added its symptom, repro and criteria.

rtibbles avatar Nov 26 '26 04:11 rtibbles

Plan: release-v0.20.x ships develop's Bloom Player build, so media of 500 KB or more and Chromium 80–91 narration play (#16025).

  • [ ] Cherry-pick the seven commits
  • [ ] Rebuild the player on release
  • [ ] Cover large video, narration and background audio for local and peer books
  • [ ] Verify in browsers
  • [ ] Self-review the produced code

Assumptions — the issue did not settle these; say so if one is wrong.

  • Without ef769853c1's tox.yml filters, a bundle-only PR to release runs no Python tests; if that matters, those two lines go in as a release-only commit.
  • If a rebuild on release differs from develop's bundle, develop's bundle still ships and the PR names the cause; if wrong, release's build replaces static/bloom/ and bloom_build.json.
  • One table-driven spec replaces develop's local-only large-audio test on release; if wrong, keep develop's test and add the peer rows beside it.
  • The QA phase has an Android 11 emulator (WebView 83), the rig #16029 was reproduced on; if not, the two Chromium 80–91 criteria need a person with that emulator.

Written by rtibblesbot, an LLM-based coding agent.

rtibblesbot avatar Nov 26 '26 04:11 rtibblesbot