# ECP-0095: Native macOS Webview First for NBC Auth and Playback

Status: Proposed

## Decision

On macOS, the Tauri app should attempt NBC playback through an in-app `WebviewWindow` backed by
`WKWebView` before launching an external browser.

The native path will:

- create a dedicated NBC auth/player window inside the app with a persistent webview data
  directory
- keep Adobe Pass / MVPD interaction inside the native app window, including popup sign-in flows
- use native `WKWebView` JavaScript evaluation and snapshot APIs to drive readiness checks and
  capture rendered frames for ffmpeg

The existing Chrome-backed path remains as a fallback when native playback cannot become ready.

## Motivation

The first NBC implementation proved that browser-backed capture is the right source model, but it
still pushes authentication into an external Chrome session. For the desktop app, that is a worse
operator experience than a native in-app window and makes session management less coherent.

Tauri 2 already exposes the platform webview and, on macOS, gives access to the underlying
`WKWebView`. That is enough to move the login and capture loop in-process without redesigning the
rest of the CMAF ladder or MoQ publish flow.

## Scope

In scope:

- macOS-only `WKWebView` session creation for NBC sources
- popup/new-window handling for MVPD login flows
- native JavaScript probing plus native snapshot capture for the existing frame pipeline
- automatic fallback to the existing Chrome path when native playback fails to get ready

Out of scope:

- removing the Chrome fallback entirely
- guaranteeing DRM parity with Chrome across every NBC playback variant
- audio capture changes beyond the current video-first path

## Alternatives Considered

- Keep the external Chrome-only path. Rejected because the native app can host the auth/player
  surface directly on macOS.
- Replace the entire source implementation with custom CEF/Chromium embedding. Rejected because it
  is materially heavier than using Tauri's existing native webview APIs.
- Use an in-app webview only for login, then continue playback in Chrome. Rejected for the first
  pass because it still splits operator state across two browser stacks.

## Rollout / Reversibility

- The change is additive and scoped to NBC handling in the Tauri app on macOS.
- If native playback proves unreliable for a given stream/auth path, the app falls back to the
  existing Chrome implementation automatically.
- Roll back by removing the native webview path and retaining the Chrome-backed implementation from
  ECP-0094.
