Skip to main content
View as Markdown

Reference - Kaltura Player

Error Handling​

ScenarioDetectionResolution
Invalid entryIdPlayer shows "Media not found" errorVerify entry exists and has status=2 (READY) via baseEntry.get
Expired or invalid KSPlayer shows access deniedGenerate a fresh KS; for production, use AppToken session renewal
Player library not loadedKalturaPlayer is not definedCheck the script src URL — verify partnerId and uiConfId are correct
Plugin not availableplayer.getService('name') returns undefinedThe plugin may not be enabled for this player config — verify uiConfId
Autoplay blocked by browserVideo loads but does not playSet 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:
    player.ready().then(() => {
    Object.keys(player.Event.Core).forEach(key => {
    player.addEventListener(player.Event.Core[key], () => {
    console.log('Event:', key);
    });
    });
    });
  • 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