Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"recommendations": [
"vscjava.vscode-lombok"
]
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ configure Maven to use Logback:
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.7</version>
<version>1.5.34</version>
</dependency>
</dependencies>
```
Expand All @@ -156,7 +156,7 @@ Or with Gradle:
```groovy
dependencies {
implementation('io.obs-websocket.community:client:2.0.0')
implementation 'ch.qos.logback:logback-classic:1.1.7'
implementation 'ch.qos.logback:logback-classic:1.5.34'
}
```

Expand Down
15 changes: 10 additions & 5 deletions client/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id 'java-library'
id 'org.unbroken-dome.test-sets' version '4.0.0'
id 'org.unbroken-dome.test-sets' version '4.1.0'
id 'jacoco'
id 'signing'
id 'maven-publish'
Expand All @@ -16,12 +16,10 @@ group = 'io.obs-websocket.community'
version = rootProject.file('VERSION').text.trim() + (isRelease ? '' : '-SNAPSHOT')
def localArchiveBaseName = 'client'

java.sourceCompatibility = JavaVersion.VERSION_1_8

dependencies {
api libs.websocket
api libs.gson
implementation libs.sl4j.api
implementation libs.slf4j.api
compileOnly libs.lombok
annotationProcessor libs.lombok

Expand All @@ -32,14 +30,21 @@ dependencies {
testCompileOnly libs.lombok
testAnnotationProcessor libs.lombok
testImplementation libs.mockito.core
testImplementation libs.sl4j.simple
testRuntimeOnly libs.junit.platform.launcher
testImplementation libs.slf4j.simple
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withSourcesJar()
withJavadocJar()
}

tasks.withType(JavaCompile).configureEach {
options.release = 8
}

testSets {
// Covers cases where OBS instance is not required
integrationTest {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package io.obswebsocket.community.client.test;

import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import com.google.gson.JsonObject;
import io.obswebsocket.community.client.message.response.inputs.GetInputMuteResponse;
import java.io.File;

import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

import com.google.gson.JsonObject;

import io.obswebsocket.community.client.message.response.inputs.GetInputMuteResponse;
import io.obswebsocket.community.client.model.MediaInputAction;

/**
* This test should be run manually, following the prompts in the command-line and observing OBS for
* the desired behavior. Authentication should be disabled. See the README in the obs-resources
Expand All @@ -21,6 +24,7 @@
public class ObsRemoteE2eObservationIT extends AbstractObsE2ETest {

@BeforeAll
@SuppressWarnings("unused")
static void beforeAll() {
connectToObs();
}
Expand All @@ -34,6 +38,7 @@ public void beforeEach() {
}

@AfterAll
@SuppressWarnings("unused")
static void afterAll() {
remote.disconnect();
// System.setProperty(org.slf4j.impl.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "Debug");
Expand All @@ -44,7 +49,8 @@ public void afterEach() {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
throw new IllegalStateException("Interrupted while waiting after manual test", e);
}
System.out.println("<< Test Complete");

Expand Down Expand Up @@ -201,24 +207,24 @@ void playPauseVlcMedia() {
remote.setSceneItemEnabled(SCENE1, vlcId, true, loggingCallback());

obsShould("Pause video 1");
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PAUSE", loggingCallback());
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, MediaInputAction.PAUSE, loggingCallback());

// BUG: Toggle Play/Pause does not work in Palakis OBS plugin!
// see https://github.com/obsproject/obs-websocket/issues/725
// I've noted we can also replicate the problem
obsShould("Toggle Play Video 1");
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PLAY", loggingCallback());
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, MediaInputAction.PLAY, loggingCallback());
obsShould("Toggle Pause Video 1");
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_PAUSE", loggingCallback());
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, MediaInputAction.PAUSE, loggingCallback());

obsShould("Switch to video 2");
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_NEXT", loggingCallback());
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, MediaInputAction.NEXT, loggingCallback());

obsShould("Restart, back at video 1 (should auto play)");
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_RESTART", loggingCallback());
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, MediaInputAction.RESTART, loggingCallback());

obsShould("Stop video 1 (going back to beginning)");
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, "OBS_WEBSOCKET_MEDIA_INPUT_ACTION_STOP", loggingCallback());
remote.triggerMediaInputAction(SOURCE_VLC_MEDIA, MediaInputAction.STOP, loggingCallback());
}

@Test
Expand Down
2 changes: 1 addition & 1 deletion example/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ version = rootProject.file('VERSION').text.trim()

dependencies {
implementation project(':client')
implementation libs.sl4j.simple
implementation libs.slf4j.simple
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
6 changes: 5 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
44 changes: 26 additions & 18 deletions gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading