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

未关闭
#8,539 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
ios, typescript
领域
mobile-dev

调研方向

从 core/native-bridge.ts 的第 418-426 行开始,那里描述了 CapacitorCookies.get prompt() 调用,并在视频播放处于活动状态时,使用链接的 capacitor-ios-video-cookie-replication 项目复现该问题。调查 iOS 在报告的设备版本中的行为;完成的标准是读取 cookie 不再暂停视频播放或导致视频无法恢复播放,包括播放期间的重复读取。

由索引模型根据 Issue 内容生成。

描述

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

Image
主要语言
TypeScript
星标
17.1k
派生
1.3k
平均合并
1 天 22 小时
30 天内合并 PR
26

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

ionic-team/capacitor 的其他 Issue

查看 ionic-team/capacitor 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。