obs_websocket_dart 0.0.2
obs_websocket_dart: ^0.0.2

Flutter Android iOS web

A package that gives you an easy-to-use API to connect to OBS using the obs-websocket plugin.

example/example.md

// import package
import 'package:obs_websocket_dart/obs_websocket_dart.dart';

// instanciate the class
ObsWebsocket obs = new ObsWebsocket();

// set debug level
// 0 -> nothing
// 1 -> what's happening
// 2 -> every send response
// 3 -> everything
obs.setDebug(1);

// pass the necessary data for the connection
obs.setAddress('127.0.0.1');
obs.setPort('4444');
obs.setPassword('*****');

// call the connect funcion and it does the rest for you
await obs.connect();

// get list of scenes, response as a variable
var getSceneList = await obs.send('GetSceneList');
for (dynamic scene in getSceneList['scenes']) {
    print(scene['name']);
}

// get list of scenes, response as a future
obs.send('GetSceneList').then((getSceneList) {
    for (dynamic scene in getSceneList['scenes']) {
        print(scene['name']);
    }
});

// listen to obs events, return a stream
obs.event('StreamStatus').listen((event) {
    print('StreamStatus: ' + event['stream-timecode'].toString() + ' at ' + event['kbits-per-sec'].toString() + 'Kb/s');
});

0
likes
90
pub points
0%
popularity

A package that gives you an easy-to-use API to connect to OBS using the obs-websocket plugin.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

renancnoronha@gmail.com

License

BSD (LICENSE)

Dependencies

crypto, flutter, web_socket_channel

More

Packages that depend on obs_websocket_dart