# Looping Videos

Source: https://dev.arcxp.com/video-center/developer-docs/video-center-player-looping-videos/

Video Center Player - Looping Videos 

You can configure a video to loop in the video player, meaning the video restarts when it reaches the end. You enable the loop functionality by setting either the `data-loop` or `data-loop-with-controls` attribute to `true`.

When the video loops, the player creates a loop event called `window.PoWa.EVENTS.LOOP`. The event’s payload contains a `loopCount` parameter that indicates how many times the video has looped.

You can also loop a [raw PoWa](https://dev.arcxp.com/video-center/developer-docs/video-without-video-center) implementation of the player.

## Examples

Enable looping without displaying the controls

```js
    <div class="powa" org="test" uuid="abcd-1234-uuid" data-loop="true"></div>
```

Enable looping displaying the controls

```js
    <div class="powa" org="test" uuid="abcd-1234-uuid" data-loop-with-controls="true"></div>
```

Log looping

```js
    window.addEventListener('powaReady', event => {
    const powa = event.detail.powa;

    powa.on(PoWa.EVENTS.LOOP, event => console.log(`Loop: ${ event.loopCount }`));
});
```
