Qriib Wesal

Flutter SDK for Qriib audio/video meetings and room management on Android and iOS. Version 1.0.0 includes the default meeting UI, optional pre-join, screen sharing, recording controls, public/private chat, meeting events and optional token renewal.

The package name is qriib_wesal. The earlier qriib_meet package is separate and is not automatically migrated.

Contents

What is included

Feature Behavior
Meeting UI Speaker/gallery layouts, participant list, draggable self-view, timer and leave confirmation
Default controls Camera, microphone, chat, raise hand, Record and Leave
Expanded controls Screen sharing, camera switching and the optional layout switch
Pre-join Optional camera/microphone preview and supported audio-device selection
Chat Public/private conversations, history, attachments, events and token renewal
Recording Server-side start/stop, observed recording status and a stop notification
Events Media lifecycle events, all 28 reference tool-message types, chat and optional polls
Customization Colors, fonts, icons, labels, control order, geometry and replacement builders
Room APIs Quick/scheduled audio/video rooms, joining, invitations, status and room information

Default meeting UI with camera, microphone, chat, hand, recording and leave controls

Chat, hand and recording controls can be visible but disabled until their required services or credentials are available. UI visibility does not grant server permissions. Desktop and web are not supported host platforms.

Version and installation

Requirements:

Component Requirement
Dart >=3.6.0 <4.0.0
Flutter >=3.29.0
Android Plugin minimum SDK 21; dependencies/toolchain may require a higher minimum
iOS 13.0 or later, using CocoaPods

Flutter >=3.29.0 is required by the pinned WebRTC plugin's Android surface API.

Add the package:

dependencies:
  qriib_wesal: ^1.0.0

Run flutter pub get, then use the public entry point:

import 'package:flutter/material.dart';
import 'package:qriib_wesal/qriib_wesal.dart';

Existing qriib_meet users should update both the dependency and import, then review the changelog. The old 0.2.1 recording-retrieval APIs (getRecord, getRecordingLink, getRecords) are not part of this package. Use only the public import; private media-engine types are not a supported API.

Configure the host

Android

The plugin's manifest contributes internet, camera, microphone and screen-share foreground-service declarations. Retain them in your merged manifest. If your host declares camera/microphone permissions explicitly, use:

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />

The SDK requests runtime media permissions when joining. For screen sharing it requests Android's capture consent before starting capture and the required foreground service. Validate media, Bluetooth and routing on physical devices.

iOS

Add the purpose strings to ios/Runner/Info.plist:

<key>NSCameraUsageDescription</key>
<string>Use the camera to share video in a meeting.</string>
<key>NSMicrophoneUsageDescription</key>
<string>Use the microphone to share audio in a meeting.</string>

Merge the permission macros into your existing Podfile post_install hook, preserving other build settings:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      definitions = config.build_settings['GCC_PREPROCESSOR_DEFINITIONS']
      definitions = definitions.nil? ? ['$(inherited)'] : Array(definitions)
      config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] =
        (definitions + ['PERMISSION_CAMERA=1', 'PERMISSION_MICROPHONE=1']).uniq
    end
  end
end

Install the host's pods after changing native configuration. This release's iOS screen sharing captures the app itself. Sharing other apps or the home screen requires a Broadcast Upload Extension that this public API does not wire up. See screen-sharing setup and limitations.

Join a meeting

Ask your authenticated backend for a fresh final_link for the intended participant. Pass that link to join from a mounted context below a MaterialApp and Scaffold.

This function can be called from your app's Join button:

Future<void> openMeeting(
  BuildContext context,
  Future<String> Function() requestFreshLink,
) async {
  try {
    final finalLink = await requestFreshLink();
    if (!context.mounted) return;

    await QriibMeetings().join(
      context: context,
      finalLink: finalLink,
      configuration: const QriibMeetingConfiguration(
        title: 'Team meeting',
        preJoin: QriibPreJoinConfiguration(enabled: true),
      ),
    );
  } catch (_) {
    if (!context.mounted) return;
    ScaffoldMessenger.of(context).showSnackBar(
      const SnackBar(content: Text('Unable to join. Please try again.')),
    );
  }
}

Disable your Join button while this future is pending to prevent duplicate navigation. A complete widget with loading/error handling is in JoinLinkExample.

  • A final_link is the service-issued joining link, not an invitation URL. Obtain one from a successful quick-create, join or scheduled-start response.
  • finalLinkFromResponse(response) reads a nested data.final_link or a top-level final_link. It returns null if no usable link exists; it does not validate expiry. If data is a map, that envelope takes precedence.
  • Joining validates the link and media-token expiry. Participant identity and permissions come from the server; userName sets the local display label.
  • Microphone permission is required. Camera permission is requested only when videoAvailable is true. Use videoAvailable: false for audio-only joining.
  • Pre-join is off by default. When enabled, cancelling it aborts joining. Keep it disabled for camera-free audio-only joining: the built-in preview starts camera and microphone capture independently of videoAvailable.
  • await join(...) completes after the meeting route closes or joining returns early, such as after pre-join cancellation.

Keep project signing secrets on your backend for distributed apps. Joining from a fresh link does not require embedding those secrets in Flutter. Links and service tokens are credentials too: do not print or send them to analytics.

Chat and token renewal

When the outer JWT in final_link?token=... contains chat_token, configure your trusted chat service endpoint. No manual token extraction is needed:

final configuration = QriibMeetingConfiguration(
  trustedChatServiceEndpoint: Uri.parse('https://your-chat.example'),
  trustedToolTokenRenewalEndpoint: Uri.parse('wss://your-tool.example/ws'),
  onEvent: (event) {
    debugPrint('${event.channel.name}: ${event.name}');
  },
);

Pass this configuration to join. Replace the example URLs with your deployment's trusted endpoints; the SDK does not select endpoints from JWT claims or the meeting URL.

Service Credentials and behavior
Chat Uses the outer chat_token; a missing token emits chat/unavailable and leaves media joining available
Tool/renewal Uses the full/tool tokens and connected room/user identifiers; reconnects and requests renewal
Raise/lower hand Uses the configured tool connection; follows host lowering and connection availability
Polls Optional polls: QriibServiceConfiguration(...) with a separate token provider

Chat and tool renewal are independently optional. An explicit chat: QriibServiceConfiguration(serviceUrl: ..., tokenProvider: ...) overrides link-based chat credentials. Chat handles its own token-renewal events.

The default chat view supports public and private conversations. For file attachments, supply chatAttachmentPicker: choose a file using your app's picker, upload with client.uploadAttachment, and return the attachment (or null to cancel). The package does not choose a file-picker plugin for you.

See events, chat, attachments and renewal for complete setup, service events and commands.

Recording

Record is visible in the primary dock by default, immediately before Leave. It does not start recording automatically. It is disabled when the local recording prerequisites are missing.

To enable the built-in command, join through a project-configured QriibMeetClient.meetings and provide:

  1. Project credentials for the recording service.
  2. An outer tool_token in the fresh final link.
  3. The server room ID, either in the link or passed as join(roomId: ...).

The server still authorizes each request. Use the response's server room ID, not clientRoomId, and keep the client alive until the meeting is closed. A plain QriibMeetings() launcher does not have a recording service.

Recording runs on the server. The public QriibRecordings.start / stop API uses V5; pass the API host or a base URL ending in /api/v4, not an already-V5 URL. Renderer layouts are speaker and gallery, independent of the local meeting layout.

The UI distinguishes a command being accepted from the room confirming its recording state. It shows “Recording stopped.” after observing an active-to-inactive transition, including a stop initiated by another participant. This does not mean the recording file has finished processing.

const recordingUi = QriibMeetingConfiguration(
  showRecordingControl: true,
  showRecordingStoppedMessage: true,
  texts: QriibMeetingTexts(
    record: 'Start recording',
    stopRecording: 'Stop recording',
    recordingStopped: 'Recording has stopped.',
    recordingUnavailable: 'Recording is unavailable for this meeting.',
  ),
);

Set showRecordingControl: false to hide the button. Set showRecordingStoppedMessage: false to provide your own notification via onRecordingStatusChanged. HTTP errors, confirmation timeouts and observed state changes have separate callbacks. See recording integration. Recording listing, playback and file-ready notifications are not exposed.

Customize the UI

The default UI bundles Geist, Almarai and Readex Pro fonts and works without downloading fonts at runtime. Change individual tokens or replace complete regions through public builders.

What to change Configuration
Colors, fonts, text styles and icons theme: QriibMeetingTheme(...)
Labels, tooltips and messages texts: QriibMeetingTexts(...)
Order, sizes, spacing, tiles and dock placement ui: QriibMeetingUi(...)
One control controlBuilder
Participant tile participantBuilder
Header or entire dock topBarBuilder, controlsBuilder
Stage, chat or complete view stageBuilder, chatBuilder, viewBuilder
Participants, audio picker or leave sheet participantsBuilder, audioDevicesBuilder, leaveConfirmationBuilder
Pre-join preJoin: QriibPreJoinConfiguration(...) and its builder

For example, change the brand and move Record into a different primary order:

final customUi = QriibMeetingConfiguration(
  theme: const QriibMeetingTheme(primaryColor: Color(0xFF00897B)),
  ui: const QriibMeetingUi(
    controlSize: 48,
    tileRadius: 16,
    primaryControls: [
      QriibMeetingControl.microphone,
      QriibMeetingControl.camera,
      QriibMeetingControl.recording,
      QriibMeetingControl.chat,
      QriibMeetingControl.leave,
    ],
    secondaryControls: [
      QriibMeetingControl.screenShare,
      QriibMeetingControl.raiseHand,
    ],
  ),
  controlBuilder: (context, action, defaultControl) {
    if (action.id != QriibMeetingControl.recording) return defaultControl;
    return IconButton(
      tooltip: action.label,
      onPressed: action.onPressed,
      icon: Icon(action.active ? Icons.stop_circle : Icons.fiber_manual_record),
    );
  },
);

Keep action.onPressed when replacing a control to preserve SDK action handling; null means the action is disabled. New region builders receive the current state, session and default child so you can decorate or replace that region. Full custom controls own their accessibility and navigation behavior.

Speaker view prioritizes an active screen share, then a pinned participant, then a recent active remote speaker. Long-press a tile to pin it. Swipe to gallery, or enable showViewModeToggle for an expanded-dock layout button. The bars hide after five seconds; controlsAutoHideDelay: null disables the timer, while tapping the stage can still toggle them.

Default UI customization contains more examples. Meeting UI reference covers flags, audio routing, session methods and widget keys.

Room management

QriibMeetClient provides signed room requests for development and integrations that can safely hold project credentials. Do not ship a project signing secret inside a distributed mobile app; dart-defines and obfuscation do not protect it.

final client = QriibMeetClient.withProjectCredentials(
  apiKey: projectApiKey,
  secretKey: projectSecretKey,
  baseUrl: 'https://api.qriib.dev/api/v4',
  enableNetworkLogging: false,
);

final response = await client.rooms.createQuickVideoRoom(
  projectId: projectId,
  clientRoomId: newClientRoomId(),
  metadata: const QriibRoomMetadata(roomTitle: 'Team meeting'),
  name: participantName,
  moderatorId: moderatorId,
  maxParticipants: 8,
  emptyTimeout: 300,
);

final link = finalLinkFromResponse(response);
if (link == null) {
  throw const QriibMeetException('The room response has no final_link.');
}

final data = response['data'];
final roomId = data is Map ? data['room_id'] : response['room_id'];
if (!context.mounted) return;
await client.meetings.join(
  context: context,
  finalLink: link,
  roomId: roomId is String ? roomId : null,
  configuration: configuration,
);

The credentials, IDs, participant name, context and configuration above are application inputs. Reuse the client and close it when its owner is disposed, after its meetings have finished.

All room operations return Future<Map<String, dynamic>>:

Operation Method
Create audio/video room createQuickAudioRoom, createQuickVideoRoom
Schedule audio/video room createScheduledAudioRoom, createScheduledVideoRoom
Start a scheduled room startScheduledRoom
Join an existing room joinRoom
Create an invitation createInvitationLink
End a room for everyone endRoom
Room status getRoomStatus
One/all active rooms getActiveRoomInfo, getActiveRoomsInfo
Past rooms fetchPastRooms

Use a new newClientRoomId() for every create request. Scheduled rooms require startAt in the service's accepted date/time format; start the scheduled room before using its fresh link. QriibRoomMetadata.roomDuration is a server-side room setting, not a local countdown enforced by the view.

Events and session controls

Use onEvent for media, chat, tool and optional poll events. Tool messages are QriibToolMessageEvent values with a typed message kind and routing data; unknown numeric message types are preserved. Avoid logging event payloads, which can contain messages or participant information.

onSessionReady exposes the public session. Listen to session.state for actual media and recording state; use session methods for microphone, camera, sharing, supported audio routing and leave actions. Sessions created by the SDK also implement QriibMeetingServices and QriibMeetingHandControls.

onDisconnected on join runs after the meeting route returns. Use media events for connection/reconnection/disconnection changes while the view is open. See the event reference for the complete matrix.

Errors and cleanup

Room HTTP errors map to QriibValidationException (400/422), QriibAuthenticationException (401/403), QriibNotFoundException (404) and QriibRateLimitException (429). They extend QriibApiException. Other HTTP and recording errors use the base exception. Meeting/link failures use QriibMeetException and its session/network subclasses.

Catch errors at your app's async UI boundary and display a suitable message. Raw exception/response content is not automatically safe to display or log. Do not blindly repeat room creation or recording commands after a timeout.

The default meeting view leaves its session on disposal and cleans up when the server disconnects the meeting, including server-enforced duration expiry. The header timer measures time since the view opened, not server room age. Custom leave controls should await session.leave() before dismissing the route. Cancel subscriptions owned by your app and do not retain a disposed session. Joining owns and disposes its pre-join preview.

Examples and troubleshooting

Run the bundled playground from the repository:

flutter pub get
cd example
flutter run

Use Open demo meeting to inspect the UI without a server. The offline demo does not verify real media, recording or service connectivity. Test those on your deployment and physical Android/iOS devices before rollout.

Symptom First check
Old UI or missing symbols Verify qriib_wesal: ^1.0.0, the resolved dependency path and public import; fully restart after changing native dependencies
Disabled Chat Configure a trusted chat endpoint and use a fresh link containing chat_token, or supply your token provider
Disabled hand control Check the tool WSS endpoint and renewal connection events
Disabled Record Check project recording service, server room ID and outer tool_token
Recording stays pending Wait for observed room confirmation; HTTP acceptance is not confirmation
Audio-only join asks for camera Pass videoAvailable: false, not only showCameraControl: false
Android surface compilation error Use a compatible Flutter SDK in both your IDE and build configuration

More help:

The package uses the Apache 2.0 license. Bundled fonts use the SIL Open Font License; see LICENSE, NOTICE and the font license files in assets/fonts.

Libraries

qriib_meet
Compatibility entry point. Prefer package:qriib_wesal/qriib_wesal.dart.
qriib_wesal
Room-management APIs and customizable Flutter meeting views for Qriib.