{"owner":"Dash-Industry-Forum","repo":"dash.js","hasSkills":true,"totalSkillsCount":3,"totalTokensCount":2103,"categories":["root-instruction","claude-rule"],"hasMcp":false,"mcpConfig":null,"found":["AGENTS.md","llms.txt","CLAUDE.md"],"skills":{"AGENTS.md":"# AGENTS.md\n\ndash.js — DASH Industry Forum reference client. Pure JS (ES2020), ESM, Node >= 20.\n\n## Gotchas\n\n### Build & Test\n- **`npm run build` skips tests/lint.** Use `npm run build-modern` for the full pipeline (clean + tsc + test + lint + webpack).\n- **No per-file test runner.** All unit tests are bundled by Karma/webpack. Filter with `--grep`:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests load from `dist/`**, not source. Build first.\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight). Public API changes may need both updated.\n- **Dev builds fewer webpack bundles than prod.** See `build/webpack/common/webpack.common.base.cjs`.\n\n### Architecture\n- **Context = DI container.** Each `MediaPlayer` creates its own `context` object. All singletons are scoped to it: `EventBus(context).getInstance()`. This enables multiple independent players on one page.\n- **Playback errors are events, API misuse throws.** Runtime/media errors use `DashJSError` + `EventBus` (`Events.ERROR`). Calling `MediaPlayer` methods before `initialize()`/`attachSource()` or with bad arguments throws synchronously. Codes in `src/core/errors/Errors.js`.\n- **Protection/DRM is opt-in.** Call `player.setProtectionData()` explicitly.\n- **`player.extend()` must be called BEFORE `initialize()`.**\n\n### Code changes\n- **PRs target `development`**, not `main`/`master`.\n- **BSD-3-Clause header required** in every new source file.\n- **v5 API — don't use deprecated v4 methods:**\n  - `getBitrateInfoListFor()` → `getRepresentationsByType(type)`\n  - `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`\n  - `getQualityFor()` → `getCurrentRepresentationForType(type)`\n- **New settings** need both `Settings.js` (value + JSDoc) and `index.d.ts`.\n- **New samples** must update `samples/samples.json`.\n\n## Where to look\n\n| What | Where |\n|---|---|\n| Build scripts | `package.json` → `scripts` |\n| Lint rules | `eslint.config.mjs` + `.editorconfig` |\n| Architecture pattern | Any `src/` file — look for `FactoryMaker` |\n| Test patterns | Any file in `test/unit/test/` |\n| Test naming | `test/unit/test/` mirrors `src/` with dot-separated paths: `core.EventBus.js` → `src/core/EventBus.js` |\n| Mocks | `test/unit/mocks/` |\n| Test fixtures | `test/unit/data/` |\n| API surface | `src/streaming/MediaPlayer.js` |\n| Public exports | `index.js` + `index_mediaplayerOnly.js` |\n| TypeScript defs | `index.d.ts` |\n| Webpack entries | `build/webpack/common/webpack.common.base.cjs` |\n| Sample registry | `samples/samples.json` |\n| CI pipelines | `.github/workflows/` |\n","llms.txt":"# dash.js\n\n> dash.js is a reference client implementation for the playback of MPEG DASH via JavaScript in browser based environments that support the Media Source Extensions and optionally the Encrypted Media Extensions.\n\n## Docs\n\n- [dash.js Quickstart](https://dashif.org/dash.js/pages/quickstart): A brief overview on how to use dash.js\n- [Installation Instructions](https://dashif.org/dash.js/pages/quickstart/installation.html): Instructions on how to obtain the dash.js bundles\n- [Setup Guide](https://dashif.org/dash.js/pages/quickstart/setup.html): An overview on how to setup dash.js in your application\n- [Usage Guide](https://dashif.org/dash.js/pages/usage/): Various examples on how to use specific features of dash.js\n\n## API\n\n- [API List](https://cdn.dashjs.org/latest/jsdoc/index.html): A complete API reference for dash.js\n\n## Examples\n\n- [Sample Section](https://reference.dashif.org/dash.js/nightly/samples/index.html): Various samples demonstrating dash.js features\n\n","CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\ndash.js is the DASH Industry Forum reference client for MPEG-DASH playback via MSE/EME. Pure JavaScript (ES2020), ESM, Node >= 20. Also see `AGENTS.md`.\n\n## Commands\n\n```bash\nnpm run dev              # tsc + webpack dev build in watch mode\nnpm start                # webpack-dev-server (serves samples, e.g. /samples/dash-if-reference-player/)\nnpm test                 # unit tests (Karma + Mocha/Chai/Sinon, headless Chrome)\nnpm run lint             # eslint on src/ and test/unit/\nnpm run build            # webpack prod bundles only — skips tsc/tests/lint\nnpm run build:dist       # clean + tsc + full modern & legacy bundles (what CI deploys)\nnpm run ci:verify        # clean + tsc + test + lint (full verification)\nnpm run test-functional  # functional tests (needs built dist/, uses test/functional/config/test-configurations/local.json)\n```\n\n- **No per-file unit test runner.** Karma bundles all tests via webpack. Filter with grep:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests run against `dist/`, not source.** Build first.\n\n## Architecture\n\n### FactoryMaker + context: the DI system\n\nEvery module follows the same closure-factory pattern — no classes:\n\n```js\nfunction GapController() {\n    const context = this.context;          // injected DI scope\n    let instance, logger;\n    // private state as closure vars, public API via `instance = {...}`\n    return instance;\n}\nGapController.__dashjs_factory_name = 'GapController';\nexport default FactoryMaker.getSingletonFactory(GapController);\n```\n\n- Each `MediaPlayer().create()` creates its own `context` object; all \"singletons\" are scoped to it (`EventBus(context).getInstance()`). This allows multiple independent players per page.\n- `FactoryMaker` (src/core/FactoryMaker.js) provides `getSingletonFactory` and `getClassFactory` and powers `player.extend()`, which replaces/overrides any named factory — but only if called **before** `initialize()`.\n- Modules communicate via `EventBus` (src/core/EventBus.js) using events defined in `src/core/events/` and `src/streaming/MediaPlayerEvents.js`, plus explicit wiring through `setConfig({...})` calls.\n\n### Layers under src/\n\n- `core/` — DI (FactoryMaker), EventBus, Settings, Debug/Logger, error definitions (`core/errors/Errors.js`).\n- `dash/` — MPD world: manifest parsing (`parser/`), `DashAdapter` (the facade the streaming layer uses to query the manifest — streaming code should not touch the parsed MPD directly), `DashHandler` (segment request generation), `DashMetrics`.\n- `streaming/` — playback engine and public API:\n  - `MediaPlayer.js` — the entire public API surface.\n  - `StreamController` → `Stream` (one per DASH period) → `StreamProcessor` (one per media type: video/audio/text) → `ScheduleController`/`BufferController`/`FragmentController` pipeline that decides, loads, and appends segments into `SourceBufferSink`.\n  - `controllers/` — PlaybackController, AbrController, GapController, CatchupController (low-latency), MediaSourceController, etc.\n  - `rules/abr/` — ABR algorithms (ThroughputRule, BolaRule, L2A, LoL+), aggregated by `ABRRulesCollection`; custom rules are pluggable.\n  - `protection/` — EME/DRM, opt-in via `player.setProtectionData()`.\n  - `net/` — HTTP loading stack (interceptors, CMCD via `@svta/cml-*` packages).\n- `mss/` — Microsoft Smooth Streaming support (separate bundle `dash.mss.min.js`).\n- `offline/` — offline download/playback.\n\n### Error model\n\nPlayback/runtime errors are **events** (`DashJSError` dispatched via `Events.ERROR`); API misuse (calling MediaPlayer methods before `initialize()`/`attachSource()`, bad arguments) **throws synchronously**.\n\n### Tests\n\n`test/unit/test/` mirrors `src/` with dot-separated filenames: `core.EventBus.js` tests `src/core/EventBus.js`. Mocks in `test/unit/mocks/`, fixtures in `test/unit/data/`.\n\n## Conventions\n\n- **PRs target `development`**, not master.\n- **BSD-3-Clause license header required** in every new source file (copy from any existing file).\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight, no DRM/text/offline). Public export changes may need both.\n- **New settings** go in `src/core/Settings.js` (value + JSDoc) **and** `index.d.ts`.\n- **New samples** must be registered in `samples/samples.json`.\n- **v5 API — don't use deprecated v4 methods:** `getBitrateInfoListFor()` → `getRepresentationsByType(type)`, `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`, `getQualityFor()` → `getCurrentRepresentationForType(type)`.\n"},"files":{"AGENTS.md":"# AGENTS.md\n\ndash.js — DASH Industry Forum reference client. Pure JS (ES2020), ESM, Node >= 20.\n\n## Gotchas\n\n### Build & Test\n- **`npm run build` skips tests/lint.** Use `npm run build-modern` for the full pipeline (clean + tsc + test + lint + webpack).\n- **No per-file test runner.** All unit tests are bundled by Karma/webpack. Filter with `--grep`:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests load from `dist/`**, not source. Build first.\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight). Public API changes may need both updated.\n- **Dev builds fewer webpack bundles than prod.** See `build/webpack/common/webpack.common.base.cjs`.\n\n### Architecture\n- **Context = DI container.** Each `MediaPlayer` creates its own `context` object. All singletons are scoped to it: `EventBus(context).getInstance()`. This enables multiple independent players on one page.\n- **Playback errors are events, API misuse throws.** Runtime/media errors use `DashJSError` + `EventBus` (`Events.ERROR`). Calling `MediaPlayer` methods before `initialize()`/`attachSource()` or with bad arguments throws synchronously. Codes in `src/core/errors/Errors.js`.\n- **Protection/DRM is opt-in.** Call `player.setProtectionData()` explicitly.\n- **`player.extend()` must be called BEFORE `initialize()`.**\n\n### Code changes\n- **PRs target `development`**, not `main`/`master`.\n- **BSD-3-Clause header required** in every new source file.\n- **v5 API — don't use deprecated v4 methods:**\n  - `getBitrateInfoListFor()` → `getRepresentationsByType(type)`\n  - `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`\n  - `getQualityFor()` → `getCurrentRepresentationForType(type)`\n- **New settings** need both `Settings.js` (value + JSDoc) and `index.d.ts`.\n- **New samples** must update `samples/samples.json`.\n\n## Where to look\n\n| What | Where |\n|---|---|\n| Build scripts | `package.json` → `scripts` |\n| Lint rules | `eslint.config.mjs` + `.editorconfig` |\n| Architecture pattern | Any `src/` file — look for `FactoryMaker` |\n| Test patterns | Any file in `test/unit/test/` |\n| Test naming | `test/unit/test/` mirrors `src/` with dot-separated paths: `core.EventBus.js` → `src/core/EventBus.js` |\n| Mocks | `test/unit/mocks/` |\n| Test fixtures | `test/unit/data/` |\n| API surface | `src/streaming/MediaPlayer.js` |\n| Public exports | `index.js` + `index_mediaplayerOnly.js` |\n| TypeScript defs | `index.d.ts` |\n| Webpack entries | `build/webpack/common/webpack.common.base.cjs` |\n| Sample registry | `samples/samples.json` |\n| CI pipelines | `.github/workflows/` |\n","llms.txt":"# dash.js\n\n> dash.js is a reference client implementation for the playback of MPEG DASH via JavaScript in browser based environments that support the Media Source Extensions and optionally the Encrypted Media Extensions.\n\n## Docs\n\n- [dash.js Quickstart](https://dashif.org/dash.js/pages/quickstart): A brief overview on how to use dash.js\n- [Installation Instructions](https://dashif.org/dash.js/pages/quickstart/installation.html): Instructions on how to obtain the dash.js bundles\n- [Setup Guide](https://dashif.org/dash.js/pages/quickstart/setup.html): An overview on how to setup dash.js in your application\n- [Usage Guide](https://dashif.org/dash.js/pages/usage/): Various examples on how to use specific features of dash.js\n\n## API\n\n- [API List](https://cdn.dashjs.org/latest/jsdoc/index.html): A complete API reference for dash.js\n\n## Examples\n\n- [Sample Section](https://reference.dashif.org/dash.js/nightly/samples/index.html): Various samples demonstrating dash.js features\n\n","CLAUDE.md":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\ndash.js is the DASH Industry Forum reference client for MPEG-DASH playback via MSE/EME. Pure JavaScript (ES2020), ESM, Node >= 20. Also see `AGENTS.md`.\n\n## Commands\n\n```bash\nnpm run dev              # tsc + webpack dev build in watch mode\nnpm start                # webpack-dev-server (serves samples, e.g. /samples/dash-if-reference-player/)\nnpm test                 # unit tests (Karma + Mocha/Chai/Sinon, headless Chrome)\nnpm run lint             # eslint on src/ and test/unit/\nnpm run build            # webpack prod bundles only — skips tsc/tests/lint\nnpm run build:dist       # clean + tsc + full modern & legacy bundles (what CI deploys)\nnpm run ci:verify        # clean + tsc + test + lint (full verification)\nnpm run test-functional  # functional tests (needs built dist/, uses test/functional/config/test-configurations/local.json)\n```\n\n- **No per-file unit test runner.** Karma bundles all tests via webpack. Filter with grep:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests run against `dist/`, not source.** Build first.\n\n## Architecture\n\n### FactoryMaker + context: the DI system\n\nEvery module follows the same closure-factory pattern — no classes:\n\n```js\nfunction GapController() {\n    const context = this.context;          // injected DI scope\n    let instance, logger;\n    // private state as closure vars, public API via `instance = {...}`\n    return instance;\n}\nGapController.__dashjs_factory_name = 'GapController';\nexport default FactoryMaker.getSingletonFactory(GapController);\n```\n\n- Each `MediaPlayer().create()` creates its own `context` object; all \"singletons\" are scoped to it (`EventBus(context).getInstance()`). This allows multiple independent players per page.\n- `FactoryMaker` (src/core/FactoryMaker.js) provides `getSingletonFactory` and `getClassFactory` and powers `player.extend()`, which replaces/overrides any named factory — but only if called **before** `initialize()`.\n- Modules communicate via `EventBus` (src/core/EventBus.js) using events defined in `src/core/events/` and `src/streaming/MediaPlayerEvents.js`, plus explicit wiring through `setConfig({...})` calls.\n\n### Layers under src/\n\n- `core/` — DI (FactoryMaker), EventBus, Settings, Debug/Logger, error definitions (`core/errors/Errors.js`).\n- `dash/` — MPD world: manifest parsing (`parser/`), `DashAdapter` (the facade the streaming layer uses to query the manifest — streaming code should not touch the parsed MPD directly), `DashHandler` (segment request generation), `DashMetrics`.\n- `streaming/` — playback engine and public API:\n  - `MediaPlayer.js` — the entire public API surface.\n  - `StreamController` → `Stream` (one per DASH period) → `StreamProcessor` (one per media type: video/audio/text) → `ScheduleController`/`BufferController`/`FragmentController` pipeline that decides, loads, and appends segments into `SourceBufferSink`.\n  - `controllers/` — PlaybackController, AbrController, GapController, CatchupController (low-latency), MediaSourceController, etc.\n  - `rules/abr/` — ABR algorithms (ThroughputRule, BolaRule, L2A, LoL+), aggregated by `ABRRulesCollection`; custom rules are pluggable.\n  - `protection/` — EME/DRM, opt-in via `player.setProtectionData()`.\n  - `net/` — HTTP loading stack (interceptors, CMCD via `@svta/cml-*` packages).\n- `mss/` — Microsoft Smooth Streaming support (separate bundle `dash.mss.min.js`).\n- `offline/` — offline download/playback.\n\n### Error model\n\nPlayback/runtime errors are **events** (`DashJSError` dispatched via `Events.ERROR`); API misuse (calling MediaPlayer methods before `initialize()`/`attachSource()`, bad arguments) **throws synchronously**.\n\n### Tests\n\n`test/unit/test/` mirrors `src/` with dot-separated filenames: `core.EventBus.js` tests `src/core/EventBus.js`. Mocks in `test/unit/mocks/`, fixtures in `test/unit/data/`.\n\n## Conventions\n\n- **PRs target `development`**, not master.\n- **BSD-3-Clause license header required** in every new source file (copy from any existing file).\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight, no DRM/text/offline). Public export changes may need both.\n- **New settings** go in `src/core/Settings.js` (value + JSDoc) **and** `index.d.ts`.\n- **New samples** must be registered in `samples/samples.json`.\n- **v5 API — don't use deprecated v4 methods:** `getBitrateInfoListFor()` → `getRepresentationsByType(type)`, `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`, `getQualityFor()` → `getCurrentRepresentationForType(type)`.\n"},"items":[{"name":"AGENTS.md","path":"AGENTS.md","rawUrl":"https://raw.githubusercontent.com/Dash-Industry-Forum/dash.js/HEAD/AGENTS.md","title":"AI Agent Protocol & Instructions","category":"root-instruction","format":"markdown","content":"# AGENTS.md\n\ndash.js — DASH Industry Forum reference client. Pure JS (ES2020), ESM, Node >= 20.\n\n## Gotchas\n\n### Build & Test\n- **`npm run build` skips tests/lint.** Use `npm run build-modern` for the full pipeline (clean + tsc + test + lint + webpack).\n- **No per-file test runner.** All unit tests are bundled by Karma/webpack. Filter with `--grep`:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests load from `dist/`**, not source. Build first.\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight). Public API changes may need both updated.\n- **Dev builds fewer webpack bundles than prod.** See `build/webpack/common/webpack.common.base.cjs`.\n\n### Architecture\n- **Context = DI container.** Each `MediaPlayer` creates its own `context` object. All singletons are scoped to it: `EventBus(context).getInstance()`. This enables multiple independent players on one page.\n- **Playback errors are events, API misuse throws.** Runtime/media errors use `DashJSError` + `EventBus` (`Events.ERROR`). Calling `MediaPlayer` methods before `initialize()`/`attachSource()` or with bad arguments throws synchronously. Codes in `src/core/errors/Errors.js`.\n- **Protection/DRM is opt-in.** Call `player.setProtectionData()` explicitly.\n- **`player.extend()` must be called BEFORE `initialize()`.**\n\n### Code changes\n- **PRs target `development`**, not `main`/`master`.\n- **BSD-3-Clause header required** in every new source file.\n- **v5 API — don't use deprecated v4 methods:**\n  - `getBitrateInfoListFor()` → `getRepresentationsByType(type)`\n  - `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`\n  - `getQualityFor()` → `getCurrentRepresentationForType(type)`\n- **New settings** need both `Settings.js` (value + JSDoc) and `index.d.ts`.\n- **New samples** must update `samples/samples.json`.\n\n## Where to look\n\n| What | Where |\n|---|---|\n| Build scripts | `package.json` → `scripts` |\n| Lint rules | `eslint.config.mjs` + `.editorconfig` |\n| Architecture pattern | Any `src/` file — look for `FactoryMaker` |\n| Test patterns | Any file in `test/unit/test/` |\n| Test naming | `test/unit/test/` mirrors `src/` with dot-separated paths: `core.EventBus.js` → `src/core/EventBus.js` |\n| Mocks | `test/unit/mocks/` |\n| Test fixtures | `test/unit/data/` |\n| API surface | `src/streaming/MediaPlayer.js` |\n| Public exports | `index.js` + `index_mediaplayerOnly.js` |\n| TypeScript defs | `index.d.ts` |\n| Webpack entries | `build/webpack/common/webpack.common.base.cjs` |\n| Sample registry | `samples/samples.json` |\n| CI pipelines | `.github/workflows/` |\n","isInternal":false,"tokens":712,"sizeBytes":2675},{"name":"llms.txt","path":"llms.txt","rawUrl":"https://raw.githubusercontent.com/Dash-Industry-Forum/dash.js/HEAD/llms.txt","title":"LLM Index & Context Digest","category":"root-instruction","format":"text","content":"# dash.js\n\n> dash.js is a reference client implementation for the playback of MPEG DASH via JavaScript in browser based environments that support the Media Source Extensions and optionally the Encrypted Media Extensions.\n\n## Docs\n\n- [dash.js Quickstart](https://dashif.org/dash.js/pages/quickstart): A brief overview on how to use dash.js\n- [Installation Instructions](https://dashif.org/dash.js/pages/quickstart/installation.html): Instructions on how to obtain the dash.js bundles\n- [Setup Guide](https://dashif.org/dash.js/pages/quickstart/setup.html): An overview on how to setup dash.js in your application\n- [Usage Guide](https://dashif.org/dash.js/pages/usage/): Various examples on how to use specific features of dash.js\n\n## API\n\n- [API List](https://cdn.dashjs.org/latest/jsdoc/index.html): A complete API reference for dash.js\n\n## Examples\n\n- [Sample Section](https://reference.dashif.org/dash.js/nightly/samples/index.html): Various samples demonstrating dash.js features\n\n","isInternal":false,"tokens":227,"sizeBytes":985},{"name":"CLAUDE.md","path":"CLAUDE.md","rawUrl":"https://raw.githubusercontent.com/Dash-Industry-Forum/dash.js/HEAD/CLAUDE.md","title":"Claude Agent Guidelines & System Prompt","category":"claude-rule","format":"markdown","content":"# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\ndash.js is the DASH Industry Forum reference client for MPEG-DASH playback via MSE/EME. Pure JavaScript (ES2020), ESM, Node >= 20. Also see `AGENTS.md`.\n\n## Commands\n\n```bash\nnpm run dev              # tsc + webpack dev build in watch mode\nnpm start                # webpack-dev-server (serves samples, e.g. /samples/dash-if-reference-player/)\nnpm test                 # unit tests (Karma + Mocha/Chai/Sinon, headless Chrome)\nnpm run lint             # eslint on src/ and test/unit/\nnpm run build            # webpack prod bundles only — skips tsc/tests/lint\nnpm run build:dist       # clean + tsc + full modern & legacy bundles (what CI deploys)\nnpm run ci:verify        # clean + tsc + test + lint (full verification)\nnpm run test-functional  # functional tests (needs built dist/, uses test/functional/config/test-configurations/local.json)\n```\n\n- **No per-file unit test runner.** Karma bundles all tests via webpack. Filter with grep:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests run against `dist/`, not source.** Build first.\n\n## Architecture\n\n### FactoryMaker + context: the DI system\n\nEvery module follows the same closure-factory pattern — no classes:\n\n```js\nfunction GapController() {\n    const context = this.context;          // injected DI scope\n    let instance, logger;\n    // private state as closure vars, public API via `instance = {...}`\n    return instance;\n}\nGapController.__dashjs_factory_name = 'GapController';\nexport default FactoryMaker.getSingletonFactory(GapController);\n```\n\n- Each `MediaPlayer().create()` creates its own `context` object; all \"singletons\" are scoped to it (`EventBus(context).getInstance()`). This allows multiple independent players per page.\n- `FactoryMaker` (src/core/FactoryMaker.js) provides `getSingletonFactory` and `getClassFactory` and powers `player.extend()`, which replaces/overrides any named factory — but only if called **before** `initialize()`.\n- Modules communicate via `EventBus` (src/core/EventBus.js) using events defined in `src/core/events/` and `src/streaming/MediaPlayerEvents.js`, plus explicit wiring through `setConfig({...})` calls.\n\n### Layers under src/\n\n- `core/` — DI (FactoryMaker), EventBus, Settings, Debug/Logger, error definitions (`core/errors/Errors.js`).\n- `dash/` — MPD world: manifest parsing (`parser/`), `DashAdapter` (the facade the streaming layer uses to query the manifest — streaming code should not touch the parsed MPD directly), `DashHandler` (segment request generation), `DashMetrics`.\n- `streaming/` — playback engine and public API:\n  - `MediaPlayer.js` — the entire public API surface.\n  - `StreamController` → `Stream` (one per DASH period) → `StreamProcessor` (one per media type: video/audio/text) → `ScheduleController`/`BufferController`/`FragmentController` pipeline that decides, loads, and appends segments into `SourceBufferSink`.\n  - `controllers/` — PlaybackController, AbrController, GapController, CatchupController (low-latency), MediaSourceController, etc.\n  - `rules/abr/` — ABR algorithms (ThroughputRule, BolaRule, L2A, LoL+), aggregated by `ABRRulesCollection`; custom rules are pluggable.\n  - `protection/` — EME/DRM, opt-in via `player.setProtectionData()`.\n  - `net/` — HTTP loading stack (interceptors, CMCD via `@svta/cml-*` packages).\n- `mss/` — Microsoft Smooth Streaming support (separate bundle `dash.mss.min.js`).\n- `offline/` — offline download/playback.\n\n### Error model\n\nPlayback/runtime errors are **events** (`DashJSError` dispatched via `Events.ERROR`); API misuse (calling MediaPlayer methods before `initialize()`/`attachSource()`, bad arguments) **throws synchronously**.\n\n### Tests\n\n`test/unit/test/` mirrors `src/` with dot-separated filenames: `core.EventBus.js` tests `src/core/EventBus.js`. Mocks in `test/unit/mocks/`, fixtures in `test/unit/data/`.\n\n## Conventions\n\n- **PRs target `development`**, not master.\n- **BSD-3-Clause license header required** in every new source file (copy from any existing file).\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight, no DRM/text/offline). Public export changes may need both.\n- **New settings** go in `src/core/Settings.js` (value + JSDoc) **and** `index.d.ts`.\n- **New samples** must be registered in `samples/samples.json`.\n- **v5 API — don't use deprecated v4 methods:** `getBitrateInfoListFor()` → `getRepresentationsByType(type)`, `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`, `getQualityFor()` → `getCurrentRepresentationForType(type)`.\n","isInternal":false,"tokens":1164,"sizeBytes":4734}],"systemPromptSnippet":"<yakaai_skills repo=\"Dash-Industry-Forum/dash.js\">\n<!-- File: AGENTS.md (Tokens: ~712 | Category: root-instruction) -->\n# AGENTS.md\n\ndash.js — DASH Industry Forum reference client. Pure JS (ES2020), ESM, Node >= 20.\n\n## Gotchas\n\n### Build & Test\n- **`npm run build` skips tests/lint.** Use `npm run build-modern` for the full pipeline (clean + tsc + test + lint + webpack).\n- **No per-file test runner.** All unit tests are bundled by Karma/webpack. Filter with `--grep`:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests load from `dist/`**, not source. Build first.\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight). Public API changes may need both updated.\n- **Dev builds fewer webpack bundles than prod.** See `build/webpack/common/webpack.common.base.cjs`.\n\n### Architecture\n- **Context = DI container.** Each `MediaPlayer` creates its own `context` object. All singletons are scoped to it: `EventBus(context).getInstance()`. This enables multiple independent players on one page.\n- **Playback errors are events, API misuse throws.** Runtime/media errors use `DashJSError` + `EventBus` (`Events.ERROR`). Calling `MediaPlayer` methods before `initialize()`/`attachSource()` or with bad arguments throws synchronously. Codes in `src/core/errors/Errors.js`.\n- **Protection/DRM is opt-in.** Call `player.setProtectionData()` explicitly.\n- **`player.extend()` must be called BEFORE `initialize()`.**\n\n### Code changes\n- **PRs target `development`**, not `main`/`master`.\n- **BSD-3-Clause header required** in every new source file.\n- **v5 API — don't use deprecated v4 methods:**\n  - `getBitrateInfoListFor()` → `getRepresentationsByType(type)`\n  - `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`\n  - `getQualityFor()` → `getCurrentRepresentationForType(type)`\n- **New settings** need both `Settings.js` (value + JSDoc) and `index.d.ts`.\n- **New samples** must update `samples/samples.json`.\n\n## Where to look\n\n| What | Where |\n|---|---|\n| Build scripts | `package.json` → `scripts` |\n| Lint rules | `eslint.config.mjs` + `.editorconfig` |\n| Architecture pattern | Any `src/` file — look for `FactoryMaker` |\n| Test patterns | Any file in `test/unit/test/` |\n| Test naming | `test/unit/test/` mirrors `src/` with dot-separated paths: `core.EventBus.js` → `src/core/EventBus.js` |\n| Mocks | `test/unit/mocks/` |\n| Test fixtures | `test/unit/data/` |\n| API surface | `src/streaming/MediaPlayer.js` |\n| Public exports | `index.js` + `index_mediaplayerOnly.js` |\n| TypeScript defs | `index.d.ts` |\n| Webpack entries | `build/webpack/common/webpack.common.base.cjs` |\n| Sample registry | `samples/samples.json` |\n| CI pipelines | `.github/workflows/` |\n\n<!-- File: llms.txt (Tokens: ~227 | Category: root-instruction) -->\n# dash.js\n\n> dash.js is a reference client implementation for the playback of MPEG DASH via JavaScript in browser based environments that support the Media Source Extensions and optionally the Encrypted Media Extensions.\n\n## Docs\n\n- [dash.js Quickstart](https://dashif.org/dash.js/pages/quickstart): A brief overview on how to use dash.js\n- [Installation Instructions](https://dashif.org/dash.js/pages/quickstart/installation.html): Instructions on how to obtain the dash.js bundles\n- [Setup Guide](https://dashif.org/dash.js/pages/quickstart/setup.html): An overview on how to setup dash.js in your application\n- [Usage Guide](https://dashif.org/dash.js/pages/usage/): Various examples on how to use specific features of dash.js\n\n## API\n\n- [API List](https://cdn.dashjs.org/latest/jsdoc/index.html): A complete API reference for dash.js\n\n## Examples\n\n- [Sample Section](https://reference.dashif.org/dash.js/nightly/samples/index.html): Various samples demonstrating dash.js features\n\n<!-- File: CLAUDE.md (Tokens: ~1164 | Category: claude-rule) -->\n# CLAUDE.md\n\nThis file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.\n\ndash.js is the DASH Industry Forum reference client for MPEG-DASH playback via MSE/EME. Pure JavaScript (ES2020), ESM, Node >= 20. Also see `AGENTS.md`.\n\n## Commands\n\n```bash\nnpm run dev              # tsc + webpack dev build in watch mode\nnpm start                # webpack-dev-server (serves samples, e.g. /samples/dash-if-reference-player/)\nnpm test                 # unit tests (Karma + Mocha/Chai/Sinon, headless Chrome)\nnpm run lint             # eslint on src/ and test/unit/\nnpm run build            # webpack prod bundles only — skips tsc/tests/lint\nnpm run build:dist       # clean + tsc + full modern & legacy bundles (what CI deploys)\nnpm run ci:verify        # clean + tsc + test + lint (full verification)\nnpm run test-functional  # functional tests (needs built dist/, uses test/functional/config/test-configurations/local.json)\n```\n\n- **No per-file unit test runner.** Karma bundles all tests via webpack. Filter with grep:\n  ```bash\n  npx karma start test/unit/config/karma.unit.conf.cjs --grep=\"EventBus\"\n  ```\n- **Functional tests run against `dist/`, not source.** Build first.\n\n## Architecture\n\n### FactoryMaker + context: the DI system\n\nEvery module follows the same closure-factory pattern — no classes:\n\n```js\nfunction GapController() {\n    const context = this.context;          // injected DI scope\n    let instance, logger;\n    // private state as closure vars, public API via `instance = {...}`\n    return instance;\n}\nGapController.__dashjs_factory_name = 'GapController';\nexport default FactoryMaker.getSingletonFactory(GapController);\n```\n\n- Each `MediaPlayer().create()` creates its own `context` object; all \"singletons\" are scoped to it (`EventBus(context).getInstance()`). This allows multiple independent players per page.\n- `FactoryMaker` (src/core/FactoryMaker.js) provides `getSingletonFactory` and `getClassFactory` and powers `player.extend()`, which replaces/overrides any named factory — but only if called **before** `initialize()`.\n- Modules communicate via `EventBus` (src/core/EventBus.js) using events defined in `src/core/events/` and `src/streaming/MediaPlayerEvents.js`, plus explicit wiring through `setConfig({...})` calls.\n\n### Layers under src/\n\n- `core/` — DI (FactoryMaker), EventBus, Settings, Debug/Logger, error definitions (`core/errors/Errors.js`).\n- `dash/` — MPD world: manifest parsing (`parser/`), `DashAdapter` (the facade the streaming layer uses to query the manifest — streaming code should not touch the parsed MPD directly), `DashHandler` (segment request generation), `DashMetrics`.\n- `streaming/` — playback engine and public API:\n  - `MediaPlayer.js` — the entire public API surface.\n  - `StreamController` → `Stream` (one per DASH period) → `StreamProcessor` (one per media type: video/audio/text) → `ScheduleController`/`BufferController`/`FragmentController` pipeline that decides, loads, and appends segments into `SourceBufferSink`.\n  - `controllers/` — PlaybackController, AbrController, GapController, CatchupController (low-latency), MediaSourceController, etc.\n  - `rules/abr/` — ABR algorithms (ThroughputRule, BolaRule, L2A, LoL+), aggregated by `ABRRulesCollection`; custom rules are pluggable.\n  - `protection/` — EME/DRM, opt-in via `player.setProtectionData()`.\n  - `net/` — HTTP loading stack (interceptors, CMCD via `@svta/cml-*` packages).\n- `mss/` — Microsoft Smooth Streaming support (separate bundle `dash.mss.min.js`).\n- `offline/` — offline download/playback.\n\n### Error model\n\nPlayback/runtime errors are **events** (`DashJSError` dispatched via `Events.ERROR`); API misuse (calling MediaPlayer methods before `initialize()`/`attachSource()`, bad arguments) **throws synchronously**.\n\n### Tests\n\n`test/unit/test/` mirrors `src/` with dot-separated filenames: `core.EventBus.js` tests `src/core/EventBus.js`. Mocks in `test/unit/mocks/`, fixtures in `test/unit/data/`.\n\n## Conventions\n\n- **PRs target `development`**, not master.\n- **BSD-3-Clause license header required** in every new source file (copy from any existing file).\n- **Two entry points:** `index.js` (full) and `index_mediaplayerOnly.js` (lightweight, no DRM/text/offline). Public export changes may need both.\n- **New settings** go in `src/core/Settings.js` (value + JSDoc) **and** `index.d.ts`.\n- **New samples** must be registered in `samples/samples.json`.\n- **v5 API — don't use deprecated v4 methods:** `getBitrateInfoListFor()` → `getRepresentationsByType(type)`, `setQualityFor()` → `setRepresentationForTypeByIndex(type, index, forceReplace)`, `getQualityFor()` → `getCurrentRepresentationForType(type)`.\n</yakaai_skills>"}