Skip to main content

Type Alias: RnMediaCastButton

type RnMediaCastButton = HybridView<RnMediaCastButtonProps>;

Defined in: packages/cast/src/specs/cast-button.nitro.ts:42

The native Google Cast button, as a React Native view.

  • iOS — a GCKUICastButton (GoogleCast/GCKUICastButton.h:22, a UIButton subclass). Left with its default triggersDefaultCastDialog = YES, so a tap presents the framework's own device dialog. That is also what drives the iOS local-network permission choreography: by SDK design discovery starts on the first tap, never before, so the OS prompt appears exactly when the user asked for devices.
  • Android — an androidx.mediarouter.app.MediaRouteButton handed to CastButtonFactory.setUpMediaRouteButton(Context, MediaRouteButton). That is the only wiring that honours CastOptions.setShowSystemOutputSwitcherOnCastIconClick(true) (which our OptionsProvider sets): on Android 13+ a tap opens the SYSTEM output switcher; below that, the in-app MediaRouteChooserDialog.

See

packages/cast/src/cast-button.tsx for the JS-facing component.