Skip to content

fix(ios): hide function bach in native shell (YouTube embed error 153) - #29

Merged
redsunjin merged 1 commit into
mainfrom
claude/bold-khayyam-91bb9f
Jul 21, 2026
Merged

fix(ios): hide function bach in native shell (YouTube embed error 153)#29
redsunjin merged 1 commit into
mainfrom
claude/bold-khayyam-91bb9f

Conversation

@redsunjin

Copy link
Copy Markdown
Owner

문제

Capacitor iOS 앱(iPad 시뮬레이터)에서 function bach 재생 시 "재생에 실패했습니다. 채널/영상 URL을 확인해주세요" 에러 발생. 웹/PWA에서는 정상.

근본 원인

네이티브 셸의 페이지 origin이 capacitor://localhost라서 YouTube 임베드 플레이어의 referrer/origin 검증에 실패함 (YouTube playability error 153 — "embedder identity missing referrer"). WKWebView는 커스텀 스킴 페이지에서 유효한 HTTP referrer를 보내지 않음.

검토한 대안

  • (a) iosScheme: 'https' 전환 — 불가: WKWebView가 http/https 스킴 핸들러 등록을 금지하므로 Capacitor iOS에서 사용할 수 없음 (Capacitor config 문서).
  • 외부 CORS 프록시 우회 — 기각: 로컬 퍼스트 도구에 외부 의존/프라이버시 부담.
  • 네이티브 referer 패치 — 기각: 커뮤니티 플러그인에서도 iOS 실패 보고 (Cap-go/capacitor-youtube-player#49).

조치 (옵션 b)

  • useBachPlayer: isNativeShell() 기반 isBachSupported 플래그 추가 — 네이티브 셸에서는 YouTube IFrame API 로드 자체를 생략.
  • MaestroHeader: isBachSupported === false면 bach 위젯 비노출. 웹/PWA 동작 불변.
  • docs/KNOWN_ISSUES.md에 KI-002로 기록.

테스트

  • UI: 네이티브 셸에서 위젯 비노출 + IFrame API 스크립트 미주입 (App.function-bach.ui.test.jsx)
  • e2e: Capacitor 브릿지 에뮬레이션 케이스 추가 (tests/e2e/maestro.e2e.spec.js) — 웹 경로는 기존 케이스 유지
  • npm test 117/117, npm run test:e2e 4/4, 웹/CAPACITOR_BUILD 빌드 통과

🤖 Generated with Claude Code

… rejected

capacitor://localhost origin fails YouTube's embed referrer check
(playability error 153), and WKWebView reserves http/https so
iosScheme cannot be switched. Gate the bach widget behind
isNativeShell(): skip loading the IFrame API and hide the header
widget in the native shell. Web/PWA behavior is unchanged.

Documented as KI-002 in docs/KNOWN_ISSUES.md with regression
coverage in the bach UI test and a native-shell-emulated e2e case.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@redsunjin
redsunjin merged commit c068243 into main Jul 21, 2026
2 checks passed
@redsunjin
redsunjin deleted the claude/bold-khayyam-91bb9f branch July 21, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants