name: playback-webview-debugging description: Use when playback, auth recovery, queue sync, or hidden WebView state diverges from native Swift state and you need to debug the DRM playback WebView, bridge events, or cookie/auth behavior. metadata: short-description: Debug playback WebView state
Playback WebView Debugging
Use this skill when playback, auth recovery, queue sync, or hidden WebView state diverges from the native Swift state.
When To Use It
- Playback starts, stops, or advances unexpectedly
- Auth looks stale and API calls return 401/403
- WebView metadata drifts from the native queue
- You need to inspect JavaScript bridge events or DOM/player state
Runtime Workflow
- Reproduce with the packaged app or
Scripts/compile_and_run.sh. - Use Xcode Console filters to watch runtime logs:
subsystem:Kaset category:playersubsystem:Kaset category:auth - In debug builds, verify
webView.isInspectable = true, then inspect the player WebView with Safari Web Inspector. - To simulate auth expiry, delete
__Secure-3PAPISIDvia Safari Web Inspector storage tools and trigger an authenticated API call. - If auth cookies or headers look suspicious, run
swift run api-explorer authand compare against the exported cookie state.
Landmarks
docs/testing.mddocs/playback.mdSources/Kaset/Views/MiniPlayerWebView.swiftSources/Kaset/Views/SingletonPlayerWebView+ObserverScript.swiftSources/Kaset/Services/Player/PlayerService.swiftSources/Kaset/Services/Player/PlayerService+WebQueueSync.swiftSources/Kaset/Services/WebKit/WebKitManager.swift