Skip to content

Every account gets 10,000 free minutes every month for video, voice and chat in your app.How the free minutes work

Guide · Developer

Build a Study Room or Watch-Together App in Flutter

Build a study-room or watch-together app in Flutter with voltkit_rtc: a room per group, tokens from your backend, video tiles, a shared screen, desks and chat.

Author
VoltKit
Published
Reading time
8 min read

A study room is a video room with a purpose: a few people, cameras on or off, a timer everyone can see, a desk each and a place to ask a question. A watch-together room is its cousin: one person shares a screen or drives a video that everyone follows. Both are a room with a handful of people and a shared state, which is what VoltKit RTC gives a Flutter app through voltkit_rtc. This guide builds one: a room per group, tokens from your backend, smooth video tiles, a shared screen, desks as seats, the timer in room metadata, chat, the app in the background and the cost.

The package targets Android 6.0 and later and iOS 13 and later; VoltKit has tested it on Android, not yet on an iPhone. Every snippet is from the Flutter SDK guide; add video calling to a Flutter app has the basic call this room grows out of.

Before you start

You need a VoltKit account and an RTC project; the quickstart creates both and gives you the API base URL and secret. A new project starts with every media option off: open the project's Settings tab, find Media and quality, and switch on video, which includes HD voice, or the SDK refuses the camera with the code media-disabled. Declare the camera and microphone in AndroidManifest.xml and Info.plist as the Flutter guide shows, then add the package:

flutter pub add voltkit_rtc flutter_webrtc

Every account gets 10,000 free participant-minutes every month, shared by all your projects, at any quality, and spent before anything paid: a study group can meet on them for a long time before a recharge. What the free minutes cover has the rules.

Step 1: a room per group, a token per person

A study group is a room with the group's id. Your backend creates it or returns the live one, and mints a short-lived token for each member with the role you decide: host for the person who opened the room, cohost for everyone who may switch on a camera, viewer for someone who only watches. Build a token server has the endpoint in five languages. In Dart, ask for it right before joining:

import 'dart:convert';

import 'package:http/http.dart' as http;

// Your own endpoint: it checks who the user is and returns { token, wsUrl }.
Future<({String token, String wsUrl})> fetchRoomCredentials(String roomId) async {
  final res = await http.post(
    Uri.parse('https://api.example.com/rooms/$roomId/token'),
    headers: {'Authorization': 'Bearer ${myAuth.accessToken}'},   // your app's login, not the API secret
  );
  if (res.statusCode != 200) throw Exception('token endpoint answered ${res.statusCode}');
  final body = jsonDecode(res.body) as Map<String, dynamic>;
  return (token: body['token'] as String, wsUrl: body['wsUrl'] as String);
}

Step 2: join and show everyone

In the room screen's State, make the client, wire the events and connect. Each remote video gets an RTCVideoRenderer; remote sound plays by itself:

// Fields: late StreamClient client; final videos = <String, RTCVideoRenderer>{};
final creds = await fetchRoomCredentials(roomId);
client = StreamClient(wsUrl: creds.wsUrl, token: creds.token);

// Wire events before connecting: tracks already being published arrive during connect().
client.onTrack.listen((t) async {
  if (t.kind != 'video') return;                 // remote sound plays without a renderer
  final renderer = RTCVideoRenderer();
  await renderer.initialize();
  renderer.srcObject = t.stream;
  setState(() => videos[t.producerId] = renderer);   // show each with RTCVideoView(renderer)
});
client.onTrackEnded.listen((e) async {
  final renderer = videos.remove(e.producerId);
  setState(() {});
  await renderer?.dispose();
});
client.onClosed.listen(handleClosed);            // why it ended: see Errors

final joined = await client.connect();           // throws RpcError when the join is refused
if (joined.role.canPublish) {
  await client.publish();                        // camera and microphone
}

A study room often starts with the microphone only: publish(constraints: {'audio': true, 'video': false}), and a later publish() adds the camera. Mute is setMicEnabled(false) and camera off is setCamEnabled(false); the room sees both on onTrackMuted, so a tile can show a name instead of a frozen frame. A grid of six cameras is hard on a phone, so tell the SDK how big each tile is with setVideoView, from a LayoutBuilder: it then receives the smallest copy that fills the tile and pauses one that scrolls out of view. Smooth on busy devices has the widget.

Step 3: desks as seats

A desk per person is a set of slots that one person holds at a time, kept by the server. A member claims a desk when they sit down, and everyone's board follows onClaimChanged:

await client.claim('seat-3');                     // slot-taken or slot-blocked if not
await client.release('seat-3');
await client.blockSlot('seat-8');                 // lock it (host or moderator); slot-occupied if held
client.onClaimChanged.listen((c) => drawSeat(c.key, c.state, c.identity));   // held, away, free, blocked

One claim per identity: claiming a second desk releases the first. A member whose connection drops keeps their desk for about a minute with the state away: draw it as taken, greyed.

Step 4: the timer and the playlist in room metadata

The shared state of the room, a study timer or the item and position of the video everyone is watching, belongs in room metadata: the host or a moderator sets it with setRoomMetadata, every participant receives onRoomMetadataChanged, and anyone who joins later reads it from joinResult.metadata. For a timer, store the end time rather than the seconds left, so a phone that joins late computes the same countdown. For watch-together, the video itself plays in your app from your own source; only the position goes through the room, and each phone seeks its own player when the metadata changes. Seats and room metadata shows the call, including requireFree, which refuses a layout change while the desks it would remove are held.

Step 5: a shared screen

For a watch-together room on Android, the host shares a screen beside the camera. The app captures the screen itself and hands the stream to the SDK; viewers receive it as a track with source == 'screen', so give it a large tile:

client.onScreenShareStarted.listen((stream) => screenPreview.srcObject = stream);
client.onScreenShareEnded.listen((_) => screenPreview.srcObject = null);
await client.publishScreen(
  stream: displayStream, // capture already acquired by the application
  options: const ScreenPublishOptions(mode: 'detail', audio: true),
);
await client.unpublishScreen();

Android requires a MediaProjection foreground service, which screen sharing sets up with two callbacks; desktop builds show a source picker first. On iOS, screen sharing is a preview that is off by default, so an iPhone watch-together room uses the metadata approach above. detail suits slides and text; motion suits video.

Step 6: questions in chat

Every room has a chat on the same connection, so a question or a "break in 5" needs no second service, and chat messages are not billed:

client.onMessage.listen((m) => setState(() => messages.add(m)));
client.onMessageDeleted.listen((e) => setState(() => messages.removeWhere((m) => m.id == e.id)));

await client.sendMessage('hello everyone');

Render text with a Text widget: it is delivered exactly as it was sent. Chat covers direct messages, moderation and history.

Step 7: the app in the background

Someone who switches to their notes should not freeze on everyone's screen. With these two options the SDK switches the camera and microphone off in the background and back on when the app returns; a video shown through setVideoView pauses at the server meanwhile, and the sound keeps playing:

client = StreamClient(
  wsUrl: creds.wsUrl,
  token: creds.token,
  pauseCameraInBackground: true,   // phones stop giving a backgrounded app its camera
  pauseMicInBackground: true,      // or false, to keep talking from the background
);

To keep sound going in the background, enable the iOS audio background mode, and on Android run a foreground service of type microphone while live. To leave, await client.close() and dispose the renderers; a closed client stays closed, so make a new StreamClient to join again.

Test it

Join the room from two phones. Sit at two desks, start the timer, switch a camera off and on, share a screen from the Android phone, send the other app to the background and bring it back. Then switch one phone from Wi-Fi to mobile data: the SDK reconnects by itself, with connectionState at reconnecting meanwhile. If one person hears their own voice back on the loudspeaker, the other phone is the cause (Echo).

What a session costs

Each connected person is billed per second at the rate of the media they use. Receiving a camera is video, even with your own camera off; a room of voices only, every camera off and no screen, is standard voice:

A one-hour study session with five people on camera

5 people × 60 minutes = 300 participant-minutes

300 participant-minutes × 99 ÷ 1,000 = 29.7 credits, ₹29.70 (≈ $0.31) at today's rate

Full HD Video + HD Audio: 99 credits per 1,000 participant-minutes. Billed per second, so a 7½-minute call costs 7½ minutes.

Prices are in Indian rupees; dollar figures are approximate, at ₹95 per US dollar on 24 October 2026, for orientation only. You are billed in rupees.

The free minutes of the month are spent first and reset on the 1st (UTC); used up, the rest is billed from your wallet or plan at the same rates.

What is a participant-minute? explains the unit; the pricing page has every rate, pricing in India a calculator.

Where to go next

While you develop, the JWT Decoder shows a test token's expiry on your own device and never sends it anywhere:

Inspect a test token with theJWT Decoder

Use test tokens only: a token is a credential for a room, and production tokens belong to the app that asked.

Frequently asked questions

What is a study room app?

A small video room where a group studies together: cameras on or off, a shared timer, a seat per person and a chat for questions. A watch-together app is the same room with one person sharing a screen or driving a video that everyone follows. Both are a room with a few people, which is what VoltKit RTC gives you.

Can a Flutter app share a screen for watch-together?

On Android, yes: publishScreen sends a screen the app captured, beside the camera, and needs a MediaProjection foreground service, which the screen sharing docs set up. On desktop builds a source picker is needed. On iOS, screen sharing is a preview that is off by default; a watch-together room on iPhone keeps everyone in sync through room metadata instead.

How do I keep everyone at the same point of a video?

Let the host write the current item and position into the room's metadata with setRoomMetadata; every participant receives onRoomMetadataChanged and seeks their own player, and anyone who joins later reads it from the join result. The video itself plays in your app, from your own source, and only the voices and cameras go through the room.

Does the Flutter SDK work on iOS?

voltkit_rtc targets Android 6.0 and later and iOS 13 and later. VoltKit has tested it on Android, not yet on an iPhone, so test on your own iPhones before a launch.

What does a study session cost?

Each connected person is billed per second at the rate of the media they use: the video rate while anyone's camera is received, the standard voice rate when it is voices only. Every account also gets a monthly allowance of free participant-minutes, spent before anything paid; the live number is on the free minutes page.

← Back to Guides

VoltKit RTC

Video and voice calls in your app

VoltKit RTC is an API and SDKs for live video, voice and chat: your server creates rooms and tokens, VoltKit runs the media, and you pay in rupees by the participant-minute.

Every account gets 10,000 free participant-minutes every month, shared by all your projects, at any quality. How the free minutes work

Standard voice from ₹39 (≈ $0.41) and Full HD video with HD audio from ₹99 (≈ $1.04) per 1,000 participant-minutes. Chat is included.

SDKs:JavaScriptReactReact NativeFlutterAndroidServer SDKs for Node.js, Python, Go, PHP and Java

You might also like

Something useful from another corner of VoltKit.