When using Datadog's automatic tracking with CapacitorCookies: { 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:
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.
We are also seeing the issue, but do not have Datadog, disabling CapacitorCookies solves the issue, but as we depend on it, that is not a viable solution.
Description:
When using Datadog's automatic tracking with CapacitorCookies: { 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:
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/0e83965c-a979-473d-b9a2-f806d630cb23
Actual Behavior: The video fails to play or stops unexpectedly.
https://github.com/user-attachments/assets/eaa38f81-af82-4f68-b325-00d8b1da13d7
Minimal reproducible example (please use your own Datadog credentials)
https://github.com/bulletbrand/safe-area-demo-repo
I’ve already created a similar issue on the Capacitor repo, but if you have any ideas or the opportunity to take a look, I would greatly appreciate it. https://github.com/ionic-team/capacitor-plugins/issues/2190
There seems to be a problem with integrating these tools