Go to file
Dominik Nakamura 2489ab49c0
Run rustfmt
2022-05-21 21:36:38 +09:00
.config Fix spelling errors copied from obs-websocket 2022-03-04 22:03:00 +09:00
.github Improve CI setup 2022-04-09 11:08:40 +09:00
examples Run rustfmt 2022-02-12 17:08:46 +09:00
src Run rustfmt 2022-05-21 21:36:38 +09:00
tests Add docs for all public items 2022-05-21 17:20:40 +09:00
.editorconfig Check all feature combinations in the CI 2021-01-10 02:04:25 +09:00
.gitignore Upload coverage to GitHub Pages instead of codecov 2021-06-14 15:48:52 +09:00
Cargo.toml Bump MSRV to 1.61 2022-05-21 21:29:11 +09:00
CHANGELOG.md Bump up version number to 0.8.0 2021-06-14 16:32:45 +09:00
deny.toml Update dependencies 2022-04-09 10:46:20 +09:00
Justfile Add new flag for llvm-cov to avoid absolute paths 2022-04-09 11:16:36 +09:00
LICENSE Initial commit 2020-12-27 22:52:56 +09:00
README.md Change to new default port 2022-01-30 00:04:30 +09:00
release.toml Add a changelog 2021-01-11 17:42:17 +09:00
rustfmt.toml Format rustfmt settings file 2021-10-25 00:11:19 +09:00

OBWS - The obws (obvious) remote control library for OBS

Build Status Repository Documentation Code Coverage

Remote control OBS with the obs-websocket plugin from Rust 🦀.

Usage

Add obws to your project with cargo add obws (needs cargo-edit) or add it manually to your Cargo.toml:

[dependencies]
obws = { git = "https://github.com/dnaka91/obws.git", branch = "v5-api" }

In addition, you will need to use the latest tokio runtime to use this library as it makes heavy use of async/await and is bound to this runtime.

Example

Here we connect to a OBS instance, get some version information and log in to access the whole API and lastly print out a list of available scenes.

For more usage instructions see the docs or check out the examples.

use anyhow::Result;
use obws::Client;

#[tokio::main]
async fn main() -> Result<()> {
    /// Connect to the OBS instance through obs-websocket.
    let client = Client::connect("localhost", 4455, Some("password")).await?;

    /// Get and print out version information of OBS and obs-websocket.
    let version = client.general().get_version().await?;
    println!("{:#?}", version);

    /// Get a list of available scenes and print them out.
    let scene_list = client.scenes().get_scene_list().await?;
    println!("{:#?}", scene_list);

    Ok(())
}

License

This project is licensed under MIT License (or http://opensource.org/licenses/MIT).