Reference - Kaltura Player
Error Handling
| Scenario | Detection | Resolution |
|---|---|---|
Invalid entryId | Player shows "Media not found" error | Verify entry exists and has status=2 (READY) via baseEntry.get |
| Expired or invalid KS | Player shows access denied | Generate a fresh KS; for production, use AppToken session renewal |
| Player library not loaded | KalturaPlayer is not defined | Check the script src URL — verify partnerId and uiConfId are correct |
| Plugin not available | player.getService('name') returns undefined | The plugin may not be enabled for this player config — verify uiConfId |
| Autoplay blocked by browser | Video loads but does not play | Set playback.autoplay: true with muted: true — browsers require muted autoplay |
Retry strategy: For transient errors (expired KS, network failures), implement KS refresh logic and retry loadMedia. For client errors (invalid entryId, missing player library, wrong uiConfId), fix the configuration before retrying — these will not resolve on their own.
Best Practices
- Use USER KS (type=0) for player embeds. Scope to specific entries with
sview:entryIdwhen possible. - Set short KS expiry (1-4 hours). For long-running pages, implement KS refresh logic.
- Use iframe embed for simple integrations. It handles library loading and configuration automatically.
- Use JS embed for programmatic control. When you need play/pause/seek, event listeners, or plugin interaction.
- Load the player library once. Cache the
<script>tag and reuse it across videos. UseKalturaPlayer.setup()for each new player instance. - Use Access Control profiles on entries for content protection (geo, domain, IP restrictions) rather than implementing client-side checks.
- Debug with a generic event listener. During development, log all player events to understand the event flow:
player.ready().then(() => {Object.keys(player.Event.Core).forEach(key => {player.addEventListener(player.Event.Core[key], () => {console.log('Event:', key);});});});
Related Guides
- Session Guide — Generate KS for access-controlled player embeds
- AppTokens — Secure KS generation for production player integrations
- API Overview — Foundation guide covering content model and API patterns
- Analytics Reports — Player events feed analytics reports
- Cue Points & Interactive Video — Chapters, slides, annotations, ads, quizzes, hotspots — data behind player timeline, navigation, and IVQ plugins
- Quiz API — Interactive video quiz lifecycle and IVQ player plugin