#feat: Sunbird content player v2 <react.js and vite> - #537
Open
JeraldJF wants to merge 5 commits into
Open
Conversation
JeraldJF
marked this pull request as ready for review
July 2, 2026 05:55
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.
Content Player v2 — unified React plugin-registry player
Summary
Introduces
@project-sunbird/content-player-v2: a single React + TypeScriptlibrary that plays every Sunbird content type through one plugin-registry shell,
replacing the per-format web-component players. One mount point, one Telemetry v3
pipeline, one responsive theme, and a zero-React
mount()/init()API forvanilla-JS/web-component hosts.
Supports: ECML (questions + slides), PDF, EPUB, Video (mp4/webm), Audio (mp3),
YouTube, and HTML/H5P/SCORM — with a graceful fallback for unknown MIME types.
Renderer decisions
@videojs/http-streamingyoutube.com/iframe_api)<div>into the iframepdfjsLib)renditionAPI into a div<iframe>srcdoc(same-origin trick); HTML/SCORM usesrcWhat's included
PluginRegistry(MIME → plugin),PluginRenderer,ContentPluginProps/ContentPluginRefcontract; hosts can register custom plugins.EcmlPlugin,PdfPlugin,EpubPlugin,VideoPlugin,YoutubePlugin,HtmlPlugin(SCORM viascorm-again),GenericPlugin(fallback).QuestionSet+ review + assessment summary, 6 questiontypes (MCQ/True-False/FTB/MTF/Sequence/Reorder), pointer-drag interactions,
slide/stage renderer.
TelemetryService(v3, batched);START/END/INTERACT/IMPRESSION/ ASSESS/ERROR/HEARTBEAT. END only on real completion; replay/exit emitINTERACT.ContentCursorcontract +ContentServicedefault (fetch + normalize).t()/getDir()across shell and all plugins;en/hi/ta/ar/fr/pt.player.css.Changes in this revision
config.downloadContent(default
true); blob-based download reliable for cross-origin URLs.EcmlPlugin.replay()now re-fires
onReadyso the shell returns toplaying(matches PDF/EPUB/Video).bottom pill), matching the questions layout; page indicator kept at bottom.
ASSESSper every question on submit(was per-interaction only, so uncommitted/skipped questions produced no event and
the collection Best-Score total came out as
x/0).unsupported/UnsupportedPlugin→generic/GenericPlugin.registry, plugin definitions, generic plugin — 38 tests).
npm run lintfailed on all files).player-v2.ymlCI (lint+test+build on push/PR; npm publish onplayer-v2-v*tag; no blob publish).console.logs;.gitignore.DS_Store.