npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

tirtc-av-react-native

v2.2.0

Published

TiRTC AV React Native SDK

Readme

TiRTC AV React Native SDK

tirtc-av-react-native is the TiRTC AV React Native New Architecture package for Android and iOS.

npm install tirtc-av-react-native

The package ships ESM JavaScript, TypeScript declarations, Codegen specs, Android native wrapper code and iOS native wrapper code. It requires React Native >=0.80.0, Android com.tange.ai:tirtc-av:2.2.8, and iOS TiRTC_AV 2.2.8 with iOS minimum 15.1.

Version 2.2.0 is a stable React Native release focused on client media output, client voice talkback and client video uplink primitives.

Imports

import {
  TiRtc,
  TiRtcConn,
  TiRtcAudioInput,
  TiRtcVideoInput,
  TiRtcAudioOutput,
  TiRtcVideoOutput,
  TiRtcVideoOutputView,
  TiRtcVideoInputPreview,
  TiRtcAudioCodec,
  TiRtcVideoCodec,
} from 'tirtc-av-react-native';

import * as TiRtcAv from 'tirtc-av-react-native';

The root export is the public API. Deep imports are not supported.

Semantic Values

String values are exported as stable as const objects and matching TypeScript union types:

TiRtcOutputBufferStrategy, TiRtcConnState, TiRtcInputState, TiRtcAudioCodec, TiRtcAudioSampleRate, TiRtcAudioChannelCount, TiRtcAudioAecMode, TiRtcAudioAgcLevel, TiRtcAudioAnsLevel, TiRtcVideoCodec, TiRtcVideoFrameRate, TiRtcCameraFacing, TiRtcVideoEncoderPreference, TiRtcVideoDecoderPreference, TiRtcVideoDecoderBackend, TiRtcVideoBitstreamFormat, TiRtcAudioOutputState, TiRtcVideoOutputState.

Use the exported values instead of hard-coded strings in app code.

Permissions

Applications own runtime permissions and platform entitlement setup before starting capture or output:

  • Android: camera, microphone, network and foreground execution policy required by the host app.
  • iOS: camera and microphone usage descriptions, user permission prompts and background behavior required by the host app.

The SDK reports platform failures through numeric TiRTC return codes and callbacks; it does not request permissions on the app's behalf.

Minimal Client

import React from 'react';
import {TiRtc, TiRtcConn, TiRtcVideoOutput, TiRtcVideoOutputView} from 'tirtc-av-react-native';

await TiRtc.initialize({appId, endpoint});

const conn = new TiRtcConn();
const videoOutput = new TiRtcVideoOutput();
videoOutput.attach(conn, streamId);

conn.onStateChanged = (state, errorCode) => {
  if (errorCode !== 0) {
    console.warn(TiRtc.formatError(errorCode));
  }
};

conn.connect(remoteDeviceId, token);

export function RemoteVideo() {
  return <TiRtcVideoOutputView output={videoOutput} resizeMode="contain" />;
}

Dispose in reverse ownership order:

videoOutput.detach();
videoOutput.dispose();
conn.disconnect();
conn.dispose();
TiRtc.shutdown();

Client Voice Talkback

import {TiRtcAudioCodec, TiRtcAudioInput} from 'tirtc-av-react-native';

const audioInput = new TiRtcAudioInput();

await audioInput.setOptions({
  codec: TiRtcAudioCodec.g711a,
});
await audioInput.attach(conn, talkbackStreamId);
await audioInput.start();

await audioInput.stop();
await audioInput.detach(conn);
await audioInput.dispose();

Client Video Uplink Primitives

TiRtcVideoInput, TiRtcVideoInputPreview and the video input option values are exported for client-side video uplink integration.

import {TiRtcVideoInput, TiRtcVideoInputPreview} from 'tirtc-av-react-native';

const videoInput = new TiRtcVideoInput();

export function LocalPreview() {
  return <TiRtcVideoInputPreview input={videoInput} resizeMode="contain" />;
}

Errors And Lifecycle

Public methods return numeric TiRTC codes instead of throwing for SDK failures. 0 means success. Use TiRtc.errorToString(code) or TiRtc.formatError(code) for display and logs.

Constructors create native owner identities, so outputs and inputs can attach to a TiRtcConn before connect(...). dispose() releases the native object only after the underlying stop/destroy call returns success. Calling dispose() again after success is valid and returns success; methods called after a successful dispose return the object released code. Input/output/view ownership is tracked by native object id plus generation so stale callbacks or recycled ids do not attach to a newer object.

Release

Version 2.2.0 is the stable React Native package for TiRTC AV client media output and talkback. It supports React Native New Architecture apps on Android and iOS and ships with Android com.tange.ai:tirtc-av:2.2.8 and iOS TiRTC_AV 2.2.8.

License

This npm package is licensed as BSD-3-Clause. The BSD-3-Clause license covers the React Native wrapper/source distributed in this package. Native TiRTC runtime binaries consumed by the Android and iOS dependencies are governed by their own distributed terms.

Package Validation

npm run lint
npm test
npm run typecheck
npm run build
npm run codegen:check