Play Khan Academy `video` widgets offline from the exercise's files
Overview
A Perseus video widget with a Khan Academy slug embeds the video from khanacademy.org, so it fails offline, and #15651 renders it as the "no longer available" standin. Kolibri should play these videos offline from the exercise's files.
Complexity: Medium Target branch: develop
The Change
- A
videowidget whoselocationstarts with${☣ LOCALPATH}/should play that file inline, through the embeddedContentViewerthat SafeHTML uses for<video>(SafeHTML/index.js#L254). - The renderer should look the file up in the
.perseusarchive first, then among the exercise's files.
Out of Scope
- Importing the referenced video into the exercise's files. learningequality/kolibri-library#33 covers that.
Acceptance Criteria
General
- [ ] A
videowidget whoselocationis${☣ LOCALPATH}/<checksum>.<ext>plays inline from the.perseusarchive when the file is there. - [ ] When the archive doesn't contain the file, the widget plays it from the exercise's files.
- [ ] Playing the video makes no request to khanacademy.org.
- [ ]
videowidgets play in questions, hints andgroupwidgets. - [ ] A
videowidget with a KA slug and no matching file shows the standin.
Accessibility
- [ ] The embedded player can be operated by keyboard, as it can in SafeHTML.
Testing
- [ ] Tests cover a file in the archive, a file on the exercise, a missing file, and a widget inside a hint and inside a
group.
References
- Perseus
videowidget, which builds the khanacademy.org embed URL from the slug.
AI usage
I decided the video ships as a separate file on the exercise, not inside the .perseus archive, and that the renderer checks the archive first, then the exercise's files. Claude Code drafted the sections with me.
@rtibbles
I would love to work on this issue can you assign this for me
/assign
Hi! 👋
Thanks so much for your interest! This issue is not open for contribution. Visit Contributing guidelines to learn about the contributing process and how to find suitable issues. If there are no unassigned 'help wanted' issues available, please wait until new ones are added.
We really appreciate your willingness to help. 😊
Are you preparing for Google Summer of Code? See our GSoC guidelines.