Webhook Documentation
Plan webhook-style playback events, progress syncing, and server-side analytics for video player integrations.
Developer intent
Use browser player events today and map them to backend webhook-style analytics pipelines.
Browser events
The current player emits postMessage events from the iframe to the parent page.
Server analytics
Forward selected events from your app to your backend for watch history, engagement, or billing logic.
Recommended payload
Store event name, TMDB ID, media type, season, episode, current time, duration, and timestamp.
Example
window.addEventListener('message', async ({ data }) => {
if (data.type === 'PLAYER_EVENT') {
await fetch('/api/analytics/player-event', {
method: 'POST',
body: JSON.stringify(data.data),
});
}
});