obs_websocket 2.0.4 copy "obs_websocket: ^2.0.4" to clipboard
obs_websocket: ^2.0.4 copied to clipboard

outdated

obs_websocket allows dart-based connections to the Open Broadcaster plugin obs-websocket

example/example.dart

import 'package:obs_websocket/obsWebsocket.dart';

void main(List<String> args) async {
  ObsWebSocket obsWebSocket = ObsWebSocket(
      connectUrl: "ws://192.168.1.84:4444",
      onEvent: (BaseEvent event) {
        print('streaming: ${event.rawEvent}');
      });

  var authRequired = await obsWebSocket.getAuthRequired();

  if (authRequired.status) {
    await obsWebSocket.authenticate(authRequired, "test");
  }

  var status = await obsWebSocket.getStreamStatus();

  if (!status.streaming) {
    final setting = StreamSetting.fromJson({
      'type': 'rtmp_custom',
      'settings': {
        'server': 'rtmp://localhost/live',
        'key': 'e799f8a080cd11ea8ab98d27449157a9'
      }
    });

    await obsWebSocket.setStreamSettings(setting);
  }

  var streamSettings = await obsWebSocket.getStreamSettings();

  print(streamSettings.settings.toString());

  obsWebSocket.close();
}
30
likes
0
points
81
downloads

Publisher

verified publishermuayid.com

Weekly Downloads

obs_websocket allows dart-based connections to the Open Broadcaster plugin obs-websocket

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, crypto, json_annotation, universal_io, web_socket_channel

More

Packages that depend on obs_websocket