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

/react-native-moq

@43cde80
Run it yourself

Software Mansion's react-native-moq — Media over QUIC (MoQ) live streaming for React Native: sub-second-latency video/audio playback, camera/mic/screen publishing, and realtime data tracks over a MoQ relay. MUST USE before writing, reviewing, or debugging ANY code that uses react-native-moq or react-native-moq-ui. Trigger on: 'react-native-moq', 'MoQ', 'Media over QUIC', 'moq relay', 'moq-kit', 'useSession', 'useBroadcasts', 'useVideoPlayer', 'useAudioPlayer', 'usePublisher', 'useCamera', 'useMultiCamera', 'useMicrophone', 'useScreenBroadcast', 'useDataTrack', 'useDataMessages', 'useAudioChunks', 'useAudioSource', 'useVideoSource', 'VideoView', 'PublisherView', 'VideoPlayerView', 'BroadcastPickerView', 'createSession', 'createPublisher', 'subscribeBroadcasts'.

Use this Skill: https://skilld.dev/gh/software-mansion-labs/skills/react-native-moq

Nothing lands on disk. Nothing to clean up.

Fork this Skill

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

referencesimperative.md

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

Using without React (imperative API)

Every hook has a create* / subscribe* counterpart for non-React code (services, state stores, other frameworks). create* returns the hook's object shape plus destroy(); subscribe* returns a subscription with start()/stop() (plus an autoStart option, default true). Nothing is cleaned up automatically — pair every create* with destroy() and every subscribe* with stop().

Hook Imperative
useSession(url) createSession(url): SessionHandle
useBroadcasts(session, prefix) subscribeBroadcasts(session, prefix, onChange, options?): BroadcastSubscription
useVideoPlayer(broadcast) createVideoPlayer(broadcast): VideoPlayerHandle
useAudioPlayer(broadcast) createAudioPlayer(broadcast): AudioPlayerHandle
useAudioChunks(...) subscribeAudioChunks(broadcast, trackName, onChunk, options?)
useDataMessages(...) subscribeDataMessages(broadcast, trackName, onMessage, options?)
usePublisher(session) createPublisher(session): PublisherHandle
useCamera / useMultiCamera / useMicrophone createCamera / createMultiCamera / createMicrophone
useDataTrack / useAudioSource / useVideoSource createDataTrack / createAudioSource / createVideoSource
useScreenBroadcast(session, options) createScreenBroadcast(session, options)

Differences from hooks:

  • Capture factories take the hook options minus enabled — creation always starts capture; toggle by destroy() + recreate.
  • createVideoSource additionally exposes ready: Promise<CustomVideoBufferDescriptor[]> — await it before pushing frames.
  • State changes surface via addListener — but the event differs per handle: capture handles (createCamera/createMicrophone/createMultiCamera/createScreenBroadcast) emit stateChange with { state, lastError }; PublisherHandle emits stateChange ({ state }) plus trackStateChange ({ name, state, error? }); players emit playingChange/trackSwitched/trackStopped/statsUpdate. The createDataTrack/createAudioSource/createVideoSource handles have no listeners — just their send/push methods plus destroy().
  • VideoPlayerHandle.destroy() only detaches listeners (the native player is shared per broadcast); AudioPlayerHandle.destroy() also releases its dedicated native player.
  • Views still need React, but accept imperative handles: <VideoView player={videoPlayerHandle}>, <PublisherView camera={cameraHandle}>.

Watch

const session = createSession(url);
session.connect();

const sub = subscribeBroadcasts(session, '', (broadcasts) => {
  if (broadcasts.length && !player) {
    player = createVideoPlayer(broadcasts[0]);
    player.play();
  }
});

// teardown
player?.destroy();
sub.stop();
session.destroy();

Publish custom media

const session = createSession(url);
session.connect();

const audio = createAudioSource({ sampleRate: 48000, channels: 1 });
const video = createVideoSource({ width: 640, height: 480, framerate: 30 });
const publisher = createPublisher(session);

await video.ready;
session.addListener('stateChange', ({ state }) => {
  if (state === 'connected') publisher.publish({ path: 'live/custom', tracks: [audio, video] });
});

// teardown (reverse order)
publisher.destroy(); // also stops publishing
audio.destroy();
video.destroy();
session.destroy();

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 alerts3mo3 checks · Risk SAFE
  • Gen Agent Trust Hub3mo

    This skill provides documentation and API references for `react-native-moq`, a React Native library for Media over QUIC (MoQ) streaming. It details how to handle sessions, publish media (camera, microphone, screen), and consume data tracks. No malicious code, obfuscation, or security vulnerabilities were detected.

  • Socket3mo

    No alerts

  • Snyk3mo

    Risk: LOW · No issues

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 4 months ago

README badge

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