Skip to content

Commit 4abd74f

Browse files
PascalThuetclaude
andcommitted
docs: clarify error handling — playback errors are events, API misuse throws
Addresses Copilot review feedback: MediaPlayer methods throw synchronously on misuse (calling before initialize/attachSource, bad arguments), while playback/runtime errors are dispatched via EventBus. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b6c7948 commit 4abd74f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ dash.js — DASH Industry Forum reference client. Pure JS (ES2020), ESM, Node >=
1616

1717
### Architecture
1818
- **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.
19-
- **Errors are events, never thrown.** Use `DashJSError` + `EventBus` (`Events.ERROR`). Codes in `src/core/errors/Errors.js`.
19+
- **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`.
2020
- **Protection/DRM is opt-in.** Call `player.setProtectionData()` explicitly.
2121
- **`player.extend()` must be called BEFORE `initialize()`.**
2222

0 commit comments

Comments
 (0)