Skip to main content
react v1.0.0 core v14.0.0

Getting Started

Start building live video experiences in minutes

What is NativeFrame?

NativeFrame is a powerful platform for adding real-time video streaming to your applications. Whether you're building a live broadcasting platform, video conferencing tool, or interactive streaming experience, NativeFrame provides the infrastructure and SDKs to make it happen.

Key capabilities:

  • Broadcast livestreams from cameras, screens, or canvas elements
  • View streams with ultra-low latency (< 1 second)
  • Group video calls with multiple participants
  • Private streaming for one-on-one interactions
  • Customizable players to match your brand
  • Cross-platform support (Web, mobile browsers)

No complex server setup required. Just add our SDK and start streaming.


Choose Your Path

NativeFrame supports both React and Vanilla JavaScript implementations:

FrameworkBest ForKey Features
ReactReact applications (16.8+)Hooks (usePreviewPlayer, useAuthClient, useCallControls), Context providers, pre-built components, TypeScript support
Vanilla JavaScriptFramework-free projects or integration with Vue, Angular, SvelteCore SDK loaded from CDN, direct API access, no build step required, maximum flexibility

Quick Start

React Implementation

Step 1: Configure .npmrc

Update your .npmrc file to include:

@video:registry=https://npm-packages.nativeframe.com/

Step 2: Installation

Install the React package via npm or yarn:

npm install @video/video-client-react

or

yarn add @video/video-client-react

That's it! The package includes everything you need: hooks, components, and TypeScript types.

Step 3: Your First Broadcaster

Let's create a simple broadcaster that streams your camera to viewers.

import React from 'react';
import {
usePreviewPlayer,
useAuthClient,
useCallControls
} from '@video/video-client-react/hooks';
import {
MediaStreamControllerAPIProvider,
PlayerAPIProvider
} from '@video/video-client-react/context';
import { Video } from '@video/video-client-react/components';

function Broadcaster() {
// Set up camera and preview
const { mediaStreamController, previewPlayer } = usePreviewPlayer();

// Set up authentication
const authClient = useAuthClient({
authUrl: 'https://your-subdomain.nativeframe.com/api/auth',
token: 'your-broadcaster-token'
});

// Configure call and broadcast
const callOptions = {
streamKey: 'your-stream-key',
backendEndpoints: ['https://your-subdomain.nativeframe.com'],
auth: authClient,
user: { userId: 'user-1', displayName: 'Broadcaster' }
};

const broadcastOptions = { streamName: 'default' };

// Get call controls (buttons to start/stop)
const { callControls } = useCallControls({
mediaStreamController,
callOptions,
broadcastOptions
});

return (
<MediaStreamControllerAPIProvider mediaStreamController={mediaStreamController}>
<PlayerAPIProvider player={previewPlayer}>
<div>
<h1>My First Livestream</h1>
<Video /> {/* Shows your camera preview */}
{callControls} {/* Start/Stop buttons */}
</div>
</PlayerAPIProvider>
</MediaStreamControllerAPIProvider>
);
}

export default Broadcaster;

That's it! You now have a working broadcaster with camera preview and controls.

Step 4: Your First Viewer

Now let's create a viewer that watches the broadcast:

import React, { useState } from 'react';
import { useAuthClient } from '@video/video-client-react/hooks';
import { PlayerAPIProvider } from '@video/video-client-react/context';
import { Video } from '@video/video-client-react/components';
import { createPlayer } from '@video/video-client-react';

function Viewer({ callId }) {
const [player, setPlayer] = useState(null);

const authClient = useAuthClient({
authUrl: 'https://your-subdomain.nativeframe.com/api/auth',
token: 'your-viewer-token'
});

React.useEffect(() => {
createPlayer({
callId: callId,
streamName: 'default',
backendEndpoints: ['https://your-subdomain.nativeframe.com'],
auth: authClient
}).then(setPlayer);

return () => player?.dispose();
}, [callId]);

if (!player) return <div>Loading stream...</div>;

return (
<PlayerAPIProvider player={player}>
<div>
<h1>Watching Livestream</h1>
<Video />
</div>
</PlayerAPIProvider>
);
}

export default Viewer;

Success! You now have a basic broadcaster and viewer. The viewer can watch the livestream with ultra-low latency.


Next Steps

Now that you have the basics working, explore more features:

📚 Essential Guides

🛠️ Resources


Understanding the Basics

Before diving deeper, here are some key concepts:

Authentication

All NativeFrame operations require authentication via JWT tokens:

  • Broadcaster tokens - Create calls and broadcast streams
  • Viewer tokens - View public streams
  • Private viewer tokens - View private/invite-only streams

Tokens are provided by your backend and include user permissions.

Calls and Broadcasts

  • A Call is a connection to the NativeFrame backend (think of it as a "room")
  • A Broadcast is an active stream within a call
  • Multiple broadcasts can exist in one call (e.g., multiple participants)
  • Viewers join calls to watch broadcasts

Media Stream Controller

Manages camera and microphone access:

  • Controls device selection
  • Toggles camera/mic on/off
  • Switches between multiple devices
  • Provides the media stream for broadcasting

Players

Display video content:

  • Preview Player - Shows your own camera (for broadcasters)
  • Player - Shows remote streams (for viewers)
  • Players automatically handle buffering, quality adaptation, and playback

Getting Help

Need Support?


What's Next?

You're ready to start building! Here are some suggested paths:

For broadcasters:

  1. Start with Set up a livestream video
  2. Add device controls and UI customization
  3. Explore advanced features like canvas streaming or screen sharing

For viewers:

  1. Start with View a stream
  2. Customize the player to match your brand
  3. Add features like quality selection and fullscreen

For interactive apps:

  1. Explore Private calls for one-on-one interactions
  2. Learn about Group calls for multi-participant video
  3. Add waiting rooms and participant management

Happy streaming! 🎥