Skip to content

Commit cad9a82

Browse files
authored
Update README.md
1 parent d4d525e commit cad9a82

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,32 @@
1+
12
# websocket-obs-java
23
### A java library for the [**OBS-Studio websocket plugin**](https://github.com/Palakis/obs-websocket) by [**Palakis**](https://github.com/Palakis).
3-
4+
---
45
## Getting started
6+
57
To get started just instantiate the OBSRemoteController:
68

79
```java
10+
811
OBSRemoteController controller = new OBSRemoteController("ws://localhost:4444", false);
912

1013
if (controller.isFailed()) { // Awaits response from OBS
1114
// Here you can handle a failed connection request
1215
}
16+
// Now you can start making requests
1317
```
1418

19+
If you don't want your program to wait for a connection you could alternatively register an onConnect callback:
20+
21+
```java
22+
controller.registerConnectCallback(response -> {
23+
GetVersionResponse version = (GetVersionResponse) response;
24+
System.out.println(version.getObsStudioVersion());
25+
26+
// Other requests...
27+
});
28+
```
29+
---
1530
## Supported requests and events
1631

1732
A list of supported requests and events can be found in the corresponding enum class files:
@@ -20,6 +35,15 @@ A list of supported requests and events can be found in the corresponding enum c
2035

2136
A description of every request and event can be found in the plugin's [**Protocol.MD**](https://github.com/Palakis/obs-websocket/blob/4.x-current/docs/generated/protocol.md) file.
2237

38+
---
2339
## Examples
2440

2541
Examples can be found [**here**](src/test/java/net/diespendendose/obsremotejava/test/OBSRemoteControllerTest.java). Just uncomment the requests you want to test or copy.
42+
43+
---
44+
## Contribution
45+
46+
If you miss an endpoint feel free to make a pull request. Any help is appreciated.
47+
48+
---
49+
**Thanks to Palakis for the great plugin!**

0 commit comments

Comments
 (0)