ionic-team / ionic-team/capacitor-plugins

[BUG] Video Pauses Every Time You Try to Play It on IOS (CapacitorCookies + Datadog Integration Issue)

Open
#2,190 10 comments 5 reactions 0 assignees View on GitHub
needs reproduction platform: ios
Dominant language
Java
Stars
678
Forks
685
Avg merge
4d 22h
Merged PRs (30d)
3

Description

## Description:
When using [Datadog's](https://www.datadoghq.com/) automatic tracking with [CapacitorCookies](https://capacitorjs.com/docs/apis/cookies): { enabled: true } in a Capacitor app on iOS, video playback for `video` tags is interrupted or fails to function properly. This issue affects all `video` elements and any libraries that use them under the hood.

Through testing, it was identified that Datadog’s automatic tracking of user interactions (e.g., route changes, button clicks) conflicts with video playback on iOS. Disabling CapacitorCookies or setting trackViewsManually in Datadog can resolve the issue temporarily, but the underlying cause seems related to how Capacitor handles cookies in combination with Datadog’s tracking.

## Environment:
IOS device/emulator 17.5 ( any version bug is reproducable )

### Plugin
CapacitorCookies with capacitor 6.0.0( any version bug is reproducable )


### Step to reproduce
1)Initialize a Capacitor iOS app with the following configuration:
```

datadogRum.init({
trackViewsManually: false,
...
});
```

2)Enable CapacitorCookies in capacitor.config.json:
```
{
"CapacitorCookies": {
"enabled": true
}
}
```

3)Add a `video` tag to any component or page:

```


Sorry, your browser doesn't support embedded videos.

```

4)Run the app on an iOS device/emulator and attempt to play the video.

**Expected Behavior:**
The video should play without any interruptions or issues.

https://github.com/user-attachments/assets/35e85295-2ec7-4676-96f2-7cc4e3b24d48

**Actual Behavior:**
The video fails to play or stops unexpectedly.

https://github.com/user-attachments/assets/1300d3d9-e8d8-4e0d-907f-5cc2b7d66398

### Minimal reproducible example (please use your own Datadog credentials)

https://github.com/bulletbrand/safe-area-demo-repo

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.