Next.js video player for App Router and Pages Router

Play Kinescope videos in a Next.js app with the open-source React component. The player runs in the browser, so you load it as a client component without server rendering; the rest of the page stays a Server Component.

Quick start

Install @kinescope/react-kinescope-player and play your first video. Commands and code are from the package README.

  1. Install the package

    The React component works with React 16 to 19.

    terminal
    npm install @kinescope/react-kinescope-player
  2. Create a client component

    In the App Router, ssr: false is allowed only in a Client Component, so put the import in a file that starts with 'use client'.

    components/kinescope-player.tsx
    'use client';
    
    import dynamic from 'next/dynamic';
    
    const KinescopePlayer = dynamic(
      () => import('@kinescope/react-kinescope-player'),
      { ssr: false }
    );
    
    export default function Player({ videoId }: { videoId: string }) {
      return <KinescopePlayer videoId={videoId} />;
    }
  3. Use it on a page

    The page itself can stay a Server Component. Pass the video ID from your Kinescope dashboard.

    app/lesson/page.tsx
    import Player from '@/components/kinescope-player';
    
    export default function LessonPage() {
      return (
        <main>
          <h1>Lesson 1</h1>
          <Player videoId="yourVideoId" />
        </main>
      );
    }
  4. React to player events

    Events are props of the component, for example to save progress or unlock the next lesson. In the Pages Router, the same next/dynamic import works without 'use client'.

    tsx
    <KinescopePlayer
      videoId={videoId}
      onTimeUpdate={({ currentTime }) => saveProgress(currentTime)}
      onEnded={() => unlockNextLesson()}
    />

Try the player API

The Next.js component controls the Kinescope web player. Call its methods on a live player below.

currentTime
0
paused
true
playbackRate
1
quality
—
volume
1
muted
false
Playback
Speed
Quality
Sound
Subtitles
player.js
import { load } from '@kinescope/player-iframe-api-loader';

const factory = await load();
const player = await factory.create('player', {
  url: 'https://kinescope.io/56Jg27MqvvttAwHcrCzEA4',
  size: { width: '100%', height: '100%' },
});

player.on(player.Events.TimeUpdate, ({ data }) => {
  console.log(data.currentTime, data.percent);
});
// Click a button on the left to run a call
Events Loads as you scroll here
  1. Events appear here once the player loads.

Every method and event is in the IFrame Player API docs.

What you get in a Next.js app

App Router and Pages Router

A client component with next/dynamic and ssr: false in the App Router, the README example in the Pages Router.

Server Components stay

Only the player file is a Client Component. Pages, layouts and data fetching keep running on the server.

Playlists

videoId accepts one ID or an array; playlistOptions sets up the playlist.

Events

onReady, onPlay, onTimeUpdate, onEnded, onQualityChanged, onError and other player events.

Protection and analytics

watermark, drmAuthToken for your authorization backend and externalId to tie views to your users.

Layout and autoplay

width and height default to 100% of the container; autoPlay="viewable" starts the video when it scrolls into view.

The platform behind the SDK

Upload and transcoding

Upload through the dashboard, the API or resumable TUS upload. Every video is encoded into adaptive renditions up to 4K. Video hosting

Own CDN

Kinescope delivers the streams your app plays from its own CDN, with points of presence in Latin America, the United States, Europe and the CIS. Video CDN

DRM on the Super plan

Widevine and FairPlay licenses are included on the Super plan. Your backend can approve each play. DRM video hosting

Live streams

Send RTMP or sRTMP from OBS, vMix or a hardware encoder and keep an automatic recording. The SDK players show the stream live. Live streaming

Analytics

Views, watch depth and drop-off points for every video. Pass your user ID from the app to see data per viewer. Video analytics

Pay as you go

Start on the free plan with 100 minutes of video and 200 GB of traffic a month. Paid usage: storage and delivery from €0.03/GB, processing €0.01/min. Pricing

Documentation

Every guide for this SDK in its repository, on GitHub.

FAQ

Can’t find the answer you need? Check out our All developer tools.

The Kinescope player runs in the browser. Loading it with next/dynamic and ssr: false skips server rendering for the player only, as the README example shows.

Move the dynamic import into a separate file that starts with 'use client' and import that component from your page, as in step 2. The Next.js docs require ssr: false to live in a Client Component.

Yes. A plain iframe works in any component, including a Server Component; the embed code generator builds it with autoplay, start time and quality.

The package lists React and React DOM 16, 17, 18 and 19 as peer dependencies.