Index of every page on this site: llms.txt
All skills
software-mansion-labs avatar

/react-native-client

@43cde80
Run it yourself

React Native / Expo SDK for Fishjam — video/audio streaming on iOS and Android. Use when writing a React Native or Expo app that calls Fishjam, configures the Fishjam Expo plugin, sets up permissions, runs background streaming, integrates CallKit, or renders RTCView. Trigger on: '@fishjam-cloud/react-native-client', 'fishjam expo plugin', 'FishjamProvider mobile', 'useCameraPermissions', 'useMicrophonePermissions', 'useForegroundService', 'useCallKit', 'useCallKitEvent', 'useCallKitService', 'RTCView', 'RTCPIPView', 'ScreenCapturePickerView', 'startPIP', 'stopPIP', 'AudioDeviceType', 'useAudioOutput', '@fishjam-cloud/react-native-webrtc', 'fishjam react native', 'expo fishjam', 'fishjam ios', 'fishjam android', 'broadcast extension'. Re-exports @fishjam-cloud/react-client hooks plus mobile-only: permissions, foreground service, iOS broadcast extension, audio routing, CallKit, Expo config plugin.

  • 11 files
  • 54.9 KB
  • MIT
  • Updated 6 months ago
  • GitHub
Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/react-native-client

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

picture-in-picture.md

≈864 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Picture-in-Picture

Picture-in-Picture lets your video call shrink into a floating window when the user backgrounds the app. iOS and Android both support it; the SDK exposes one component (RTCPIPView) and two helper functions (startPIP, stopPIP).

Plugin prerequisite

{
  "ios": {
    "supportsPictureInPicture": true
  },
  "android": {
    "supportsPictureInPicture": true
  }
}

For iOS, ios.supportsPictureInPicture: true adds audio to UIBackgroundModes (and nothing else). You do not need enableVoIPBackgroundMode for PIP.

Enabling PIP on a tile (preferred)

Pass a pip options object to RTCView. The OS auto-promotes the view to the floating window when the app backgrounds — no ref, no AppState listener needed.

import { RTCView } from '@fishjam-cloud/react-native-client';

<RTCView
  mediaStream={remotePeer.cameraTrack.stream}
  pip={{
    enabled: true,
    startAutomatically: true,
    stopAutomatically: true,
    allowsCameraInBackground: true,
    preferredSize: { width: 16, height: 9 },
  }}
/>

RTCPIPOptions defaults: enabled: true, startAutomatically: true, stopAutomatically: true, allowsCameraInBackground: false. If pip is omitted, PIP is disabled for that tile. allowsCameraInBackground is iOS 16+.

The canonical example app (examples/mobile-react-native/fishjam-chat/components/VideosGrid.tsx) uses exactly this pattern.

RTCPIPView + manual startPIP / stopPIP (escape hatch)

Use this only if you need imperative control (e.g. trigger PIP from a button mid-foreground). RTCPIPView is a forwardRef — attach a ref so you can later call startPIP / stopPIP:

import { RTCPIPView, startPIP, stopPIP } from '@fishjam-cloud/react-native-client';
import { useRef } from 'react';
import type { ComponentRef } from 'react';

const pipRef = useRef<ComponentRef<typeof RTCPIPView>>(null);

<RTCPIPView ref={pipRef} mediaStream={remotePeer.cameraTrack.stream} style={{ flex: 1 }} />;

startPIP(pipRef);
stopPIP(pipRef);

Only the most recently mounted RTCPIPView is eligible for PIP at a time. Pair with AppState if you want to auto-trigger on background — but prefer the declarative pip prop above.

Android

Android handles PIP automatically when:

  • The activity declares android:supportsPictureInPicture="true" (the plugin adds this).
  • The view is mounted with pip={{ enabled: true }} (or you call startPIP explicitly). Without the pip prop, no PIP — defaults to off.
  • The user presses Home / backgrounds the app.

The declarative pip={{ enabled: true, startAutomatically: true }} form works on both platforms.

Foreground service pairing (Android)

For PIP to keep streaming, the peer connection still needs to be alive — which means a foreground service. Combine useForegroundService (see foreground-service.md) with RTCPIPView.

VoIP background mode (iOS)

If your app uses CallKit (useCallKit), enable ios.enableVoIPBackgroundMode: true in the plugin. This lets the WebRTC connection persist while PIP is showing.

Sources

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No third-party reports yet.

Signed by skilld at 43cde80. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 weeks ago.

Activeupdated 6 months ago

README badge

README badge for software-mansion-labs/skills/react-native-client