Player API
Updated September 26, 2026
The player talks to the page around it with postMessage.
Commands
const player = document.querySelector('iframe').contentWindow;
player.postMessage({ pellio: true, method: 'play' }, '*');
player.postMessage({ pellio: true, method: 'seek', value: 42 }, '*');
| method | value |
|---|---|
play, pause |
none |
seek |
seconds |
mute |
true or false |
volume |
0 to 1 |
rate |
playback speed, for example 1.5 |
identify |
the viewer’s email, to name them in analytics |
Events
The player posts { pellio: true, id, event, currentTime, duration } to the parent page for ready, play, pause, seeked, timeupdate, ratechange, volumechange, ended and complete. It also posts progress (with percent at 25, 50, 75 and 90), interaction when an interaction is shown or used, and lead (with the email) when a form is submitted.
window.addEventListener('message', (e) => {
if (e.data?.pellio && e.data.event === 'progress') console.log(e.data.id, e.data.percent);
});