Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Accessing document.cookie after being patched by cookies plugin causes YouTube iframe player to pause playback #7877

Open
1 of 3 tasks
anson0370 opened this issue Feb 8, 2025 · 1 comment
Labels

Comments

@anson0370
Copy link

Capacitor Version

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1

Installed Dependencies:

@capacitor/cli: 6.2.0
@capacitor/android: 6.2.0
@capacitor/core: 6.2.0
@capacitor/ios: 6.2.0

[success] iOS looking great! 👌

Other API Details

pnpm 9.15.3
node v20.18.1
pod 1.14.3

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

I embedded a YouTube iframe player in my application. Whenever any code accesses document.cookie, it causes the player to pause automatically.

This issue currently only occurs in the Capacitor iOS environment when using the Capacitor cookie plugin.

Expected Behavior

Accessing document.cookie should not affect the state of the YouTube iframe player.

Project Reproduction

https://github.com/anson0370/yt-player-capacitor-issue

Additional Information

I've also opened the same issue with Google, and I'm not sure which side the problem is actually on.

https://issuetracker.google.com/issues/395212983

@anson0370
Copy link
Author

After further research and verification, I believe this issue is related to the code here:

const res = prompt(JSON.stringify(payload));

Capacitor uses window.prompt to transfer data. And YouTube iframe player pauses after the prompt is called. I don't know why the YouTube iframe player pauses after a prompt call, and whether this behavior is necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant