Skip to main content

webrtc_coordinator_flutter 0.2.3 copy "webrtc_coordinator_flutter: ^0.2.3" to clipboard
webrtc_coordinator_flutter: ^0.2.3 copied to clipboard

The flutter_webrtc binding for webrtc_coordinator, supplies an RtcPeerAdapter.

webrtc_coordinator_flutter #

Pub Version

webrtc_coordinator_flutter connects webrtc_coordinator to flutter_webrtc. It provides an RtcPeerAdapter based on real peer connections, so that peer_coordinator sessions run peer-to-peer over WebRTC data channels in a Flutter application.

The transport logic (the dial state machine, routing, framing and streams) is in the pure-Dart webrtc_coordinator package, where it is tested against a fake adapter. This package adds the parts that require a device: SDP, ICE and SCTP. It is a separate package because flutter_webrtc is a plugin with native code.

API documentation

Installation #

flutter pub add webrtc_coordinator_flutter

Usage #

import 'package:peer_coordinator/websocket.dart' show HubCredentials;
import 'package:webrtc_coordinator_flutter/webrtc_coordinator_flutter.dart';

final session = PeerSession.create(
  CoordinationConfig(
    name: 'my_experiment',
    sessionConfig: CoordinationSessionConfig(name: 'lab', maxNodes: 4),
    transportConfig: RtcTransportConfig(
      hubUri: Uri.parse('ws://hub.local:8080'),
      credentials: HubCredentials(session: 'lab', secret: hubSecret),
      adapterFactory: flutterWebrtcAdapterFactory,
      // For peers on different networks, add STUN/TURN servers:
      // iceServers: [{'urls': 'stun:stun.l.google.com:19302'}],
    ),
  ),
);
await session.initialize();
await session.join();

The hub handles discovery, election and signalling, and is started with dart run peer_coordinator:hub (see the peer_coordinator README). All other traffic passes directly between peers.

Platform setup #

Only data channels are used, so an application only requires network access.

Platform Configuration
Android <uses-permission android:name="android.permission.INTERNET"/> in AndroidManifest.xml
macOS The entitlements com.apple.security.network.client and com.apple.security.network.server
iOS, Windows, Linux, web None

The flutter_webrtc documentation covers further platform-specific details.

0
likes
160
points
591
downloads

Documentation

API reference

Publisher

verified publisherzeyus.com

Weekly Downloads

The flutter_webrtc binding for webrtc_coordinator, supplies an RtcPeerAdapter.

Homepage
Repository (GitHub)
View/report issues
Contributing

License

MIT (license)

Dependencies

flutter, flutter_webrtc, logging, peer_coordinator, webrtc_coordinator

More

Packages that depend on webrtc_coordinator_flutter