ionic-team / ionic-team/capacitor
[Bug]: prompt()-based cookie reads pause media playback on iOS
- Dominant language
- TypeScript
- Stars
- 16.7k
- Forks
- 1.3k
- Avg merge
- 3d 15h
- Merged PRs (30d)
- 10
Description
### Capacitor Version
💊 Capacitor Doctor 💊
Latest Dependencies:
@capacitor/cli: 8.4.2
@capacitor/core: 8.4.2
@capacitor/android: 8.4.2
@capacitor/ios: 8.4.2
Installed Dependencies:
@capacitor/android: not installed
@capacitor/cli: 8.4.2
@capacitor/core: 8.4.2
@capacitor/ios: 8.4.2
[success] iOS looking great! 👌
### Other API Details
```Shell
```
### Platforms Affected
- [x] iOS
- [ ] Android
- [ ] Web
### Current Behavior
Video playback is paused (and not resumed) when reading cookie with CapacitorCookies enabled.
### Expected Behavior
Video playback should be uninterrupted by cookie retrieval.
### Project Reproduction
https://github.com/richard-jfc/capacitor-ios-video-cookie-replication
### Additional Information
The use of `prompt(JSON.stringify({type: 'CapacitorCookies.get'}))` causes video playback to be paused: https://github.com/ionic-team/capacitor/blob/1834b9740e200fd96f866975d54515d49ef1aa97/core/native-bridge.ts#L418-L426
This is particularly problematic with a library like mux where the library is repeatedly setting cookie while the video is playing.
This doesn't happen on iOS 16 devices (My iPhone 8).
Contributor guide
Research direction
Start with core/native-bridge.ts lines 418-426, where the CapacitorCookies.get prompt() call is described, and reproduce the issue using the linked capacitor-ios-video-cookie-replication project while video playback is active. Investigate the iOS behavior across the reported device versions; done means cookie reads no longer pause or fail to resume video playback, including repeated reads during playback.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, typescript
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100