---
updatedAt: 2026-07-27T10:45:36.000Z
agentTools:
  projectIndex: https://developers.dailymotion.com/v0/llms.txt
---

# Listen to Player events (Web)

Work with events to capture user interactions with the Player and trigger custom actions.

Listening to events can only be implemented with the Player Embed Script or Player Library Script, not with iFrame embeds.

Find all available events in the [Web SDK Reference](https://developers.dailymotion.com/v0/reference/web-sdk-player-events).

***

# Listen to events

<br />

**To pick up on events** use the method [`player.on()`](https://developers.dailymotion.com/v0/reference/web-sdk-player-methods#events-management-web):

```javascript
player.on(dailymotion.events.YOUR_EVENT, callback) // callback function will be trigger each time 'YOUR_EVENT' is fired

player.on(dailymotion.events.YOUR_EVENT, callback, { once: true }) // callback function will be trigger only the first time 'YOUR_EVENT' is fired
```

<br />

**Example of adding a listener to the Player event** `PLAYER_START`:

```javascript
player.on(dailymotion.events.PLAYER_START, (state) => {
  console.log("Received PLAYER_START event. Current state is:", state);
});
```

<HTMLBlock>{`
<iframe height="300" style="width: 100%;" scrolling="no" title="[Doc] - Player embed script - event listeners" src="https://codepen.io/team/dailymotion-developer/embed/VwzpLXq?default-tab=html%2Cresult&theme-id=40175" frameborder="no" loading="lazy" allowtransparency="true" allowfullscreen="true">

  See the Pen <a href="https://codepen.io/team/dailymotion-developer/pen/VwzpLXq">
  [Doc] - Player embed script - event listeners</a> by dailymotion-developer (<a href="https://codepen.io/team/dailymotion-developer">@dailymotion-developer</a>)
  on <a href="https://codepen.io">CodePen</a>.
</iframe>
`}</HTMLBlock>

<br />

**Example of adding a unique listener:**

If you want a listener to be invoked only once, pass an additional object composed of `{once:true}` into the method.

```javascript
player.on(
  dailymotion.events.PLAYER_START,
  (state) => {
    console.log("Received PLAYER_START event. Current state is:", state);
  },
  { once: true }
);
```

<br />

***

# Stop listening to an event

**To unbind specified listeners**, use `player.off()`:

```javascript
player.off(dailymotion.events.YOUR_EVENT, callback) // the specific callback associated to 'YOUR_EVENT' will be removed

player.off(dailymotion.events.YOUR_EVENT) // every listeners binded to 'YOUR_EVENT' will be removed
```

<br />