Skip to content

[Bug]: prompt()-based cookie reads pause media playback on iOS#8539

Description

@richard-jfc

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

Platforms Affected

  • 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:

if (platform === 'ios') {
// Use prompt to synchronously get cookies.
// https://stackoverflow.com/questions/29249132/wkwebview-complex-communication-between-javascript-native-code/49474323#49474323
const payload = {
type: 'CapacitorCookies.get',
};
const res = prompt(JSON.stringify(payload));

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).

Image

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions