Skip to main content

Shared Core Remote Podcast Tutorial

Build a headless remote-podcast controller with mediasfu-shared@1.1.0. Your application renders people and media, while shared core supplies the published recording start and stop operations for an active room.

Prerequisites

  • Node.js 18 to 20 and a TypeScript application with a live room runtime.
  • A renderer for participants and recording notices, plus app-owned storage policy.
  • An authenticated backend that controls who may start recording.

Project files

package.json
{"private":true,"type":"module","scripts":{"typecheck":"tsc --noEmit"},"dependencies":{"mediasfu-shared":"1.1.0","mediasoup-client":"3.20.0","socket.io-client":"4.8.3"},"devDependencies":{"typescript":"5.9.3"}}
tsconfig.json
{"compilerOptions":{"strict":true,"target":"ES2022","module":"ESNext","moduleResolution":"bundler","lib":["DOM","ES2022"],"skipLibCheck":true,"noEmit":true},"include":["src/**/*.ts"]}
src/podcast.ts
import { startRecording, stopRecording } from 'mediasfu-shared';
export type PodcastRuntime={start:Parameters<typeof startRecording>[0];stop:Parameters<typeof stopRecording>[0]};
export async function controlRecording(runtime:PodcastRuntime){await startRecording(runtime.start);await stopRecording(runtime.stop)}
src/app-boundaries.ts
import type { PodcastRuntime } from './podcast';
export type PodcastRenderer={showRecordingNotice():void;showFailure(message:string):void;clearRoom():void};
export type PodcastApplication={runtime:PodcastRuntime;renderer:PodcastRenderer;mayRecord:boolean};

Run

npm install
npm run typecheck

Expected result

When the active room allows recording and your app has authorized the host, controlRecording sends the start and stop operations. Your renderer makes the recording state visible to every affected participant.

Recovery

Treat recording denial, recording-start failure, reconnect, and storage unavailability separately. Do not say a recording is retrievable until your own storage and retrieval process confirms it.

Cleanup

Stop recording, apply your retention policy, unmount the renderer, and close application-owned media resources. Personal leave does not end the room for all.

Release boundary

The backend owns recording authorization, consent policy, and storage decisions. Shared core is a headless runtime and does not safely create hosted rooms from a browser; do not expose a MediaSFU Cloud credential in this project.