diff --git a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java index 7bf192e7..8ea31ede 100644 --- a/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java +++ b/openvidu-test-e2e/src/test/java/io/openvidu/test/e2e/OpenViduTestAppE2eTest.java @@ -1033,7 +1033,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { } }); - user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .filter-btn")).click(); + user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .other-operations-btn")).click(); Thread.sleep(1000); user.getDriver().findElement(By.id("apply-filter-btn")).click(); user.getDriver().findElement(By.id("close-dialog-btn")).click(); @@ -2160,7 +2160,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { Assert.assertTrue("Video is not average green", RecordingUtils.checkVideoAverageRgbGreen(rgb)); // Try to apply none allowed filter - user.getDriver().findElement(By.cssSelector(".filter-btn")).click(); + user.getDriver().findElement(By.cssSelector(".other-operations-btn")).click(); Thread.sleep(1000); WebElement filterTypeInput = user.getDriver().findElement(By.id("filter-type-field")); @@ -2242,7 +2242,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { Assert.assertTrue("Video is not average gray", RecordingUtils.checkVideoAverageRgbGray(rgb)); // Remove filter - user.getDriver().findElement(By.cssSelector(".filter-btn")).click(); + user.getDriver().findElement(By.cssSelector(".other-operations-btn")).click(); Thread.sleep(500); user.getDriver().findElement(By.id("remove-filter-btn")).click(); user.getWaiter().until( @@ -2308,7 +2308,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true)); // Publisher applies ZBarCode filter to itself - user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .filter-btn")).click(); + user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .other-operations-btn")).click(); Thread.sleep(500); WebElement input = user.getDriver().findElement(By.id("filter-type-field")); input.clear(); @@ -2353,7 +2353,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { Thread.sleep(500); // Moderator subscribes to CodeFound event for the Publisher's stream - user.getDriver().findElement(By.cssSelector("#openvidu-instance-1 .filter-btn")).click(); + user.getDriver().findElement(By.cssSelector("#openvidu-instance-1 .other-operations-btn")).click(); Thread.sleep(500); input = user.getDriver().findElement(By.id("filter-event-type-field")); input.clear(); @@ -4052,7 +4052,7 @@ public class OpenViduTestAppE2eTest extends AbstractOpenViduTestappE2eTest { event.keySet().size()); // Filter event webhook - user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .filter-btn")).click(); + user.getDriver().findElement(By.cssSelector("#openvidu-instance-0 .other-operations-btn")).click(); Thread.sleep(500); WebElement input = user.getDriver().findElement(By.id("filter-type-field")); input.clear(); diff --git a/openvidu-testapp/src/app/app.module.ts b/openvidu-testapp/src/app/app.module.ts index 3de65373..c5bf6a29 100644 --- a/openvidu-testapp/src/app/app.module.ts +++ b/openvidu-testapp/src/app/app.module.ts @@ -24,7 +24,7 @@ import { SessionApiDialogComponent } from './components/dialogs/session-api-dial import { EventsDialogComponent } from './components/dialogs/events-dialog/events-dialog.component'; import { PublisherPropertiesDialogComponent } from './components/dialogs/publisher-properties-dialog/publisher-properties-dialog.component'; import { ScenarioPropertiesDialogComponent } from './components/dialogs/scenario-properties-dialog/scenario-properties-dialog.component'; -import { FilterDialogComponent } from './components/dialogs/filter-dialog/filter-dialog.component'; +import { OtherStreamOperationsDialogComponent } from './components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component'; import { ShowCodecDialogComponent } from './components/dialogs/show-codec-dialog/show-codec-dialog.component'; import { RecordingPropertiesComponent } from './components/dialogs/recording-properties/recording-properties.component'; @@ -52,7 +52,7 @@ import { ShowIceServerConfiguredDialog } from './components/dialogs/show-configu LocalRecordingDialogComponent, PublisherPropertiesDialogComponent, ScenarioPropertiesDialogComponent, - FilterDialogComponent, + OtherStreamOperationsDialogComponent, ShowCodecDialogComponent, ShowIceServerConfiguredDialog, SessionInfoDialogComponent, @@ -82,7 +82,7 @@ import { ShowIceServerConfiguredDialog } from './components/dialogs/show-configu LocalRecordingDialogComponent, PublisherPropertiesDialogComponent, ScenarioPropertiesDialogComponent, - FilterDialogComponent, + OtherStreamOperationsDialogComponent, ShowCodecDialogComponent, ShowIceServerConfiguredDialog, SessionInfoDialogComponent diff --git a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.css b/openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.css similarity index 100% rename from openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.css rename to openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.css diff --git a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.html b/openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.html similarity index 51% rename from openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.html rename to openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.html index 23fa0dcd..4d460d07 100644 --- a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.html +++ b/openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.html @@ -1,10 +1,10 @@
-
+

Filter application

- + @@ -27,22 +27,35 @@ - - -
-

Filter events

+
+

Filter events

+ + + + + + + + + + + +
+

Speech To Text

- + - - - - - + + + +
+ + +
\ No newline at end of file diff --git a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts b/openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.ts similarity index 72% rename from openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts rename to openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.ts index ec1818fb..86b5517d 100644 --- a/openvidu-testapp/src/app/components/dialogs/filter-dialog/filter-dialog.component.ts +++ b/openvidu-testapp/src/app/components/dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component.ts @@ -5,33 +5,35 @@ import { Session, Stream, FilterEvent } from 'openvidu-browser'; @Component({ selector: 'app-session-api-dialog', - templateUrl: './filter-dialog.component.html', - styleUrls: ['./filter-dialog.component.css'], + templateUrl: './other-stream-operations-dialog.component.html', + styleUrls: ['./other-stream-operations-dialog.component.css'], }) -export class FilterDialogComponent { +export class OtherStreamOperationsDialogComponent { session: Session; stream: Stream; filterEventHandler: (FilterEvent) => void; - filterType = 'GStreamerFilter'; - filterOptions = '{"command": "videobalance saturation=0.0"}'; + filterType = 'GStreamerFilter'; // 'VB:image'; + filterOptions = '{"command": "videobalance saturation=0.0"}'; // '{"url": "https://openvidu.io/img/vb/office.jpeg"}'; - filterMethod = 'setElementProperty'; - filterParams = '{"propertyName":"saturation","propertyValue":"1.0"}'; + filterMethod = 'setElementProperty'; // 'update'; + filterParams = '{"propertyName":"saturation","propertyValue":"1.0"}'; // '{"url": "http://localhost:4443/virtual-background/backgrounds/mountain.jpeg", "maskRadius":0.1, "backgroundCoverage":0.6, "lightWrapping":0.3}'; eventType: string; + sttLang: string = 'en-US'; + response: string; - constructor(public dialogRef: MatDialogRef, + constructor(public dialogRef: MatDialogRef, @Inject(MAT_DIALOG_DATA) public data) { this.session = data.session; this.stream = data.stream; this.filterEventHandler = data.filterEventHandler; } - apply() { + applyFilter() { console.log('Applying filter'); this.stream.applyFilter(this.filterType, JSON.parse(this.filterOptions)) .then(() => { @@ -101,4 +103,22 @@ export class FilterDialogComponent { } } + async subStt() { + try { + await this.session.subscribeToSpeechToText(this.stream, this.sttLang); + this.response = 'Subscribed to STT'; + } catch (error) { + this.response = 'Error [' + error.message + ']'; + } + } + + async unsubStt() { + try { + await this.session.unsubscribeFromSpeechToText(this.stream); + this.response = 'Unsubscribed from STT'; + } catch (error) { + this.response = 'Error [' + error.message + ']'; + } + } + } diff --git a/openvidu-testapp/src/app/components/video/video.component.css b/openvidu-testapp/src/app/components/video/video.component.css index 669916b4..badcc3bf 100644 --- a/openvidu-testapp/src/app/components/video/video.component.css +++ b/openvidu-testapp/src/app/components/video/video.component.css @@ -64,7 +64,7 @@ p { float: right; } -.filter-btn { +.other-operations-btn { float: right; } diff --git a/openvidu-testapp/src/app/components/video/video.component.html b/openvidu-testapp/src/app/components/video/video.component.html index 8ac8d698..8e62aba0 100644 --- a/openvidu-testapp/src/app/components/video/video.component.html +++ b/openvidu-testapp/src/app/components/video/video.component.html @@ -5,8 +5,8 @@ - - - - diff --git a/openvidu-testapp/src/app/components/video/video.component.ts b/openvidu-testapp/src/app/components/video/video.component.ts index f87d9a93..a20a7421 100644 --- a/openvidu-testapp/src/app/components/video/video.component.ts +++ b/openvidu-testapp/src/app/components/video/video.component.ts @@ -21,7 +21,7 @@ import { MuteSubscribersService } from '../../services/mute-subscribers.service' import { Subscription } from 'rxjs'; import { LocalRecordingDialogComponent } from '../dialogs/local-recording-dialog/local-recording-dialog.component'; import { ExtensionDialogComponent } from '../dialogs/extension-dialog/extension-dialog.component'; -import { FilterDialogComponent } from '../dialogs/filter-dialog/filter-dialog.component'; +import { OtherStreamOperationsDialogComponent } from '../dialogs/other-stream-operations-dialog/other-stream-operations-dialog.component'; import { OpenViduEvent } from '../openvidu-instance/openvidu-instance.component'; import { ShowIceServerConfiguredDialog } from '../dialogs/show-configured-ice/show-configured-ice.component'; @@ -69,7 +69,6 @@ export class VideoComponent implements OnInit, OnDestroy { pubSubAudioIcon = 'mic'; recordIcon = 'fiber_manual_record'; pauseRecordIcon = ''; - captionIcon = 'closed_caption_disabled'; // Stats usedVideoCodec: string; @@ -166,7 +165,6 @@ export class VideoComponent implements OnInit, OnDestroy { this.pubSubVideoIcon = ''; this.pubSubAudioIcon = ''; - this.captionIcon = ''; this.recordIcon = ''; this.pauseRecordIcon = ''; this.pubSubIcon = 'play_arrow'; @@ -187,7 +185,6 @@ export class VideoComponent implements OnInit, OnDestroy { this.pubSubVideoIcon = 'videocam'; this.pubSubAudioIcon = 'mic'; - this.captionIcon = 'closed_caption_disabled'; this.recordIcon = 'fiber_manual_record'; this.pauseRecordIcon = ''; this.pubSubIcon = 'stop'; @@ -337,15 +334,6 @@ export class VideoComponent implements OnInit, OnDestroy { .catch(error => console.error(`Error while reconnecting stream ${this.streamManager.stream} (${this.streamManager.remote ? 'Subscriber' : 'Publisher'})`, error)); } - async speechToText() { - if (this.captionIcon === 'closed_caption_disabled') { - await this.streamManager.stream.session.subscribeToSpeechToText(this.streamManager.stream, 'en-US'); - } else { - await this.streamManager.stream.session.unsubscribeFromSpeechToText(this.streamManager.stream); - } - this.captionIcon = this.captionIcon === 'closed_caption_disabled' ? 'closed_caption' : 'closed_caption_disabled'; - } - updateSubscriberEvents(oldValues) { const sub: Subscriber = this.streamManager; @@ -806,8 +794,8 @@ export class VideoComponent implements OnInit, OnDestroy { this.OV.session.forceDisconnect(this.streamManager.stream.connection); } - filterConfig() { - this.dialog.open(FilterDialogComponent, { + otherOperations() { + this.dialog.open(OtherStreamOperationsDialogComponent, { data: { session: this.streamManager.stream.session, stream: this.streamManager.stream,