---
title: Reference
url: https://docs.kaltura.com/docs/embeddable-kaltura-products/kaltura-player/player-embed-reference
---

## 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:entryId` when 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. Use `KalturaPlayer.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:
  ```javascript
  player.ready().then(() => {
    Object.keys(player.Event.Core).forEach(key => {
      player.addEventListener(player.Event.Core[key], () => {
        console.log('Event:', key);
      });
    });
  });
  ```

## Related Guides

- **[Session Guide](/docs/getting-started/authentication/ks-overview)** — Generate KS for access-controlled player embeds
- **[AppTokens](/docs/getting-started/authentication/app-tokens-overview)** — Secure KS generation for production player integrations
- **[API Overview](/docs/getting-started/general/api-overview)** — Foundation guide covering content model and API patterns
- **[Analytics Reports](/docs/rich-media-cms-apis/analytics/analytics-overview)** — Player events feed analytics reports  
- **[Cue Points & Interactive Video](/docs/embeddable-kaltura-products/kaltura-player/cue-points)** — Chapters, slides, annotations, ads, quizzes, hotspots — data behind player timeline, navigation, and IVQ plugins
- **[Quiz API](/docs/embeddable-kaltura-products/kaltura-player/video-quiz)** — Interactive video quiz lifecycle and IVQ player plugin
