Skip to main content

robot_stream_webrtc 0.1.0 copy "robot_stream_webrtc: ^0.1.0" to clipboard
robot_stream_webrtc: ^0.1.0 copied to clipboard

Low-latency WebRTC/WHEP video source and Flutter widget for ROS 2 robots via flutter_webrtc, with Android low-latency WifiLock.

example/main.dart

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

void main() => runApp(const MaterialApp(home: WebrtcExamplePage()));

/// Minimal example streaming WebRTC/WHEP video from a MediaMTX server.
class WebrtcExamplePage extends StatefulWidget {
  const WebrtcExamplePage({super.key, this.host = '192.168.1.100', this.token});

  final String host;
  final String? token;

  @override
  State<WebrtcExamplePage> createState() => _WebrtcExamplePageState();
}

class _WebrtcExamplePageState extends State<WebrtcExamplePage> {
  final _source = WhepSource(robotId: 'robot1');

  @override
  void initState() {
    super.initState();
    _source.connect(
      mediamtxWhepUri(host: widget.host),
      token: widget.token == null ? null : mediamtxCredential(widget.token!),
    );
  }

  @override
  void dispose() {
    _source.dispose();
    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text('WebRTC/WHEP Example')),
      body: Center(
        child: RobotVideoView(
          source: _source,
          placeholder: const CircularProgressIndicator(),
        ),
      ),
    );
  }
}
0
likes
150
points
55
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Low-latency WebRTC/WHEP video source and Flutter widget for ROS 2 robots via flutter_webrtc, with Android low-latency WifiLock.

Repository (GitHub)
View/report issues
Contributing

Topics

#ros #ros2 #robotics #webrtc #whep

License

BSD-3-Clause (license)

Dependencies

flutter, flutter_webrtc, http, robot_stream_core

More

Packages that depend on robot_stream_webrtc

Packages that implement robot_stream_webrtc