diff --git a/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/BrowserUser.java b/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/BrowserUser.java index 01fc9c460e..eb861b4d69 100644 --- a/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/BrowserUser.java +++ b/openvidu-test-browsers/src/main/java/io/openvidu/test/browsers/BrowserUser.java @@ -20,7 +20,6 @@ import java.awt.Point; import java.time.Duration; import java.time.temporal.ChronoUnit; -import java.util.Collections; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -164,83 +163,23 @@ public void stopVideoTracksOfVideoElement(WebElement videoElement, String parent ((JavascriptExecutor) driver).executeScript(script); } - public boolean assertMediaTracks(WebElement videoElement, boolean audioTransmission, boolean videoTransmission, - String parentSelector) { - return this.assertMediaTracks(Collections.singleton(videoElement), audioTransmission, videoTransmission, - parentSelector); - } - - public boolean assertMediaTracks(Iterable mediaElements, boolean audioTransmission, - boolean videoTransmission) { - boolean success = true; - for (WebElement mediaElement : mediaElements) { - if (!waitUntilSrcObjectDefined(mediaElement, "", 5000)) { - System.err.println("srcObject of HTMLVideoElement was not defined!"); - return false; - } - success = success && (audioTransmission == this.hasAudioTracks(mediaElement, "")) - && (videoTransmission == this.hasVideoTracks(mediaElement, "")); - if (!success) - break; - } - return success; - } - - public boolean assertMediaTracks(Iterable videoElements, boolean audioTransmission, - boolean videoTransmission, String parentSelector) { - boolean success = true; - for (WebElement video : videoElements) { - if (!waitUntilSrcObjectDefined(video, "", 5000)) { - System.err.println("srcObject of HTMLVideoElement was not defined!"); - return false; - } - success = success && (audioTransmission == this.hasAudioTracks(video, parentSelector)) - && (videoTransmission == this.hasVideoTracks(video, parentSelector)); - if (!success) - break; + public boolean assertAllElementsHaveTracks(String querySelector, boolean hasAudio, boolean hasVideo) { + String calculateReturnValue = "returnValue && "; + if (hasAudio) { + calculateReturnValue += "el.srcObject.getAudioTracks().length === 1 && el.srcObject.getAudioTracks()[0].enabled"; + } else { + calculateReturnValue += "el.srcObject.getAudioTracks().length === 0"; } - return success; - } - - private boolean hasAudioTracks(WebElement mediaElement, String parentSelector) { - String script = "return ((document.querySelector('" + parentSelector + (parentSelector.isEmpty() ? "" : " ") - + "#" + mediaElement.getAttribute("id") + "').srcObject.getAudioTracks().length === 1)" - + " && (document.querySelector('" + parentSelector + (parentSelector.isEmpty() ? "" : " ") + "#" - + mediaElement.getAttribute("id") + "').srcObject.getAudioTracks()[0].enabled))"; - boolean audioTracks = (boolean) ((JavascriptExecutor) driver).executeScript(script); - return audioTracks; - } - - private boolean hasVideoTracks(WebElement mediaElement, String parentSelector) { - String script = "return ((document.querySelector('" + parentSelector + (parentSelector.isEmpty() ? "" : " ") - + "#" + mediaElement.getAttribute("id") + "').srcObject.getVideoTracks().length === 1)" - + " && (document.querySelector('" + parentSelector + (parentSelector.isEmpty() ? "" : " ") + "#" - + mediaElement.getAttribute("id") + "').srcObject.getVideoTracks()[0].enabled))"; - boolean videoTracks = (boolean) ((JavascriptExecutor) driver).executeScript(script); - return videoTracks; - } - - private boolean waitUntilSrcObjectDefined(WebElement videoElement, String parentSelector, int maxMsWait) { - final int sleepInterval = 50; - int maxIterations = maxMsWait / sleepInterval; - int counter = 0; - boolean defined = srcObjectDefined(videoElement, parentSelector); - while (!defined && counter < maxIterations) { - try { - Thread.sleep(sleepInterval); - } catch (InterruptedException e) { - } - defined = srcObjectDefined(videoElement, parentSelector); - counter++; + calculateReturnValue += " && "; + if (hasVideo) { + calculateReturnValue += "el.srcObject.getVideoTracks().length === 1 && el.srcObject.getVideoTracks()[0].enabled"; + } else { + calculateReturnValue += "el.srcObject.getVideoTracks().length === 0"; } - return defined; - } - - private boolean srcObjectDefined(WebElement videoElement, String parentSelector) { - String script = "return (!!(document.querySelector('" + parentSelector + (parentSelector.isEmpty() ? "" : " ") - + "#" + videoElement.getAttribute("id") + "').srcObject))"; - boolean defined = (boolean) ((JavascriptExecutor) driver).executeScript(script); - return defined; + String script = "var returnValue = true; document.querySelectorAll('" + querySelector + + "').forEach(el => { returnValue = " + calculateReturnValue + " }); return returnValue;"; + boolean tracks = (boolean) ((JavascriptExecutor) driver).executeScript(script); + return tracks; } } \ No newline at end of file diff --git a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java index 35c246b0a6..de0a92c528 100644 --- a/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java +++ b/openvidu-test-e2e/src/main/java/io/openvidu/test/e2e/OpenViduTestE2e.java @@ -44,9 +44,9 @@ public class OpenViduTestE2e { protected static String MEDIA_SERVER_IMAGE = "livekit-server:latest"; - protected static String LIVEKIT_API_KEY = "key1"; - protected static String LIVEKIT_API_SECRET = "abcdefghijklmnopqrstuvwxyz123456"; - protected static String LIVEKIT_URL = "wss://localhost:1880/"; + protected static String LIVEKIT_API_KEY = "devkey"; + protected static String LIVEKIT_API_SECRET = "secret"; + protected static String LIVEKIT_URL = "ws://localhost:7880/"; protected static String APP_URL = "https://localhost:4200/"; protected static String OPENVIDU_PRO_LICENSE = "not_valid"; 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 9b854bf8d4..b067323abf 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 @@ -24,7 +24,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; @@ -102,20 +101,15 @@ private void oneToOneAux(OpenViduTestappUser user) throws Exception { Assertions.assertEquals(4, numberOfVideos, "Wrong number of videos"); Assertions.assertEquals(4, numberOfAudios, "Wrong number of audios"); - Assertions.assertTrue(user.getBrowserUser() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true), + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("video", false, true), "HTMLVideoElements were expected to have only one video track"); - Assertions - .assertTrue( - user.getBrowserUser().assertMediaTracks( - user.getDriver().findElements(By.cssSelector("audio.remote")), true, false), - "HTMLAudioElements were expected to have only one audio track"); + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("audio.remote", true, false), + "HTMLAudioElements were expected to have only one audio track"); gracefullyLeaveParticipants(user, 2); } @Test @DisplayName("One2One only audio") - @Disabled void oneToOneOnlyAudioSession() throws Exception { OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("chrome"); @@ -124,26 +118,33 @@ void oneToOneOnlyAudioSession() throws Exception { user.getDriver().findElement(By.id("one2one-btn")).click(); - user.getDriver().findElements(By.className("send-video-checkbox")).forEach(el -> el.click()); + for (int n = 0; n < 2; n++) { + user.getDriver().findElement(By.id("room-options-btn-" + n)).click(); + Thread.sleep(300); + user.getDriver().findElement(By.id("video-capture-false")).click(); + user.getDriver().findElement(By.id("close-dialog-btn")).click(); + Thread.sleep(300); + } + user.getDriver().findElements(By.className("connect-btn")).forEach(el -> el.sendKeys(Keys.ENTER)); - user.getEventManager().waitUntilEventReaches("connectionCreated", "RoomEvent", 4); - user.getEventManager().waitUntilEventReaches("accessAllowed", "RoomEvent", 2); - user.getEventManager().waitUntilEventReaches("streamCreated", "RoomEvent", 4); - user.getEventManager().waitUntilEventReaches("streamPlaying", "RoomEvent", 4); + user.getEventManager().waitUntilEventReaches("connected", "RoomEvent", 2); + user.getEventManager().waitUntilEventReaches("localTrackPublished", "RoomEvent", 2); + user.getEventManager().waitUntilEventReaches("trackSubscribed", "RoomEvent", 2); final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); - Assertions.assertEquals(4, numberOfVideos, "Wrong number of videos"); - Assertions.assertTrue(user.getBrowserUser() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), true, false), - "Videos were expected to only have audio tracks"); + Assertions.assertEquals(0, numberOfVideos, "Wrong number of videos"); + final int numberOfAudios = user.getDriver().findElements(By.tagName("audio")).size(); + Assertions.assertEquals(4, numberOfAudios, "Wrong number of audios"); + + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("audio.remote", true, false), + "HTMLAudioElements were expected to have only one audio track"); gracefullyLeaveParticipants(user, 2); } @Test @DisplayName("One2One only video") - @Disabled void oneToOneOnlyVideoSession() throws Exception { OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("chrome"); @@ -152,19 +153,27 @@ void oneToOneOnlyVideoSession() throws Exception { user.getDriver().findElement(By.id("one2one-btn")).click(); - user.getDriver().findElements(By.className("send-audio-checkbox")).forEach(el -> el.click()); + for (int n = 0; n < 2; n++) { + user.getDriver().findElement(By.id("room-options-btn-" + n)).click(); + Thread.sleep(300); + user.getDriver().findElement(By.id("audio-capture-false")).click(); + user.getDriver().findElement(By.id("close-dialog-btn")).click(); + Thread.sleep(300); + } + user.getDriver().findElements(By.className("connect-btn")).forEach(el -> el.sendKeys(Keys.ENTER)); - user.getEventManager().waitUntilEventReaches("connectionCreated", "RoomEvent", 4); - user.getEventManager().waitUntilEventReaches("accessAllowed", "RoomEvent", 2); - user.getEventManager().waitUntilEventReaches("streamCreated", "RoomEvent", 4); - user.getEventManager().waitUntilEventReaches("streamPlaying", "RoomEvent", 4); + user.getEventManager().waitUntilEventReaches("connected", "RoomEvent", 2); + user.getEventManager().waitUntilEventReaches("localTrackPublished", "RoomEvent", 2); + user.getEventManager().waitUntilEventReaches("trackSubscribed", "RoomEvent", 2); + final int numberOfAudios = user.getDriver().findElements(By.tagName("audio")).size(); + Assertions.assertEquals(0, numberOfAudios, "Wrong number of audios"); final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); Assertions.assertEquals(4, numberOfVideos, "Wrong number of videos"); - Assertions.assertTrue(user.getBrowserUser() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true), - "Videos were expected to only have video tracks"); + + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("video", false, true), + "HTMLVideoElements were expected to have only one audio track"); gracefullyLeaveParticipants(user, 2); } @@ -177,34 +186,33 @@ void oneToManyVideoAudioSession() throws Exception { log.info("One2Many [Video + Audio]"); + final int SUBSCRIBERS = 7; + final int USERS = SUBSCRIBERS + 1; + WebElement one2ManyInput = user.getDriver().findElement(By.id("one2many-input")); one2ManyInput.clear(); - one2ManyInput.sendKeys("3"); + one2ManyInput.sendKeys(Integer.toString(SUBSCRIBERS)); user.getDriver().findElement(By.id("auto-join-checkbox")).click(); user.getDriver().findElement(By.id("one2many-btn")).click(); - user.getEventManager().waitUntilEventReaches("signalConnected", "RoomEvent", 4); - user.getEventManager().waitUntilEventReaches("connected", "RoomEvent", 4); + user.getEventManager().waitUntilEventReaches("signalConnected", "RoomEvent", USERS); + user.getEventManager().waitUntilEventReaches("connected", "RoomEvent", USERS); user.getEventManager().waitUntilEventReaches("localTrackPublished", "RoomEvent", 2); - user.getEventManager().waitUntilEventReaches("trackSubscribed", "RoomEvent", 6); + user.getEventManager().waitUntilEventReaches("trackSubscribed", "RoomEvent", (SUBSCRIBERS) * 2); - user.getWaiter().until(ExpectedConditions.numberOfElementsToBe(By.tagName("video"), 4)); - user.getWaiter().until(ExpectedConditions.numberOfElementsToBe(By.tagName("audio"), 4)); + user.getWaiter().until(ExpectedConditions.numberOfElementsToBe(By.tagName("video"), USERS)); + user.getWaiter().until(ExpectedConditions.numberOfElementsToBe(By.tagName("audio"), USERS)); final int numberOfVideos = user.getDriver().findElements(By.tagName("video")).size(); final int numberOfAudios = user.getDriver().findElements(By.tagName("audio")).size(); - Assertions.assertEquals(4, numberOfVideos, "Wrong number of videos"); - Assertions.assertEquals(4, numberOfAudios, "Wrong number of audios"); + Assertions.assertEquals(USERS, numberOfVideos, "Wrong number of videos"); + Assertions.assertEquals(USERS, numberOfAudios, "Wrong number of audios"); - Assertions.assertTrue(user.getBrowserUser() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true), + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("video", false, true), "HTMLVideoElements were expected to have only one video track"); - Assertions - .assertTrue( - user.getBrowserUser().assertMediaTracks( - user.getDriver().findElements(By.cssSelector("audio.remote")), true, false), - "HTMLAudioElements were expected to have only one audio track"); + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("audio.remote", true, false), + "HTMLAudioElements were expected to have only one audio track"); - gracefullyLeaveParticipants(user, 4); + gracefullyLeaveParticipants(user, USERS); } @Test @@ -234,46 +242,48 @@ void manyToManyVideoAudioSession() throws Exception { Assertions.assertEquals(16, numberOfVideos, "Wrong number of videos"); Assertions.assertEquals(16, numberOfAudios, "Wrong number of audios"); - Assertions.assertTrue(user.getBrowserUser() - .assertMediaTracks(user.getDriver().findElements(By.tagName("video")), false, true), + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("video", false, true), "HTMLVideoElements were expected to have only one video track"); - Assertions - .assertTrue( - user.getBrowserUser().assertMediaTracks( - user.getDriver().findElements(By.cssSelector("audio.remote")), true, false), - "HTMLAudioElements were expected to have only one audio track"); + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("audio.remote", true, false), + "HTMLAudioElements were expected to have only one audio track"); gracefullyLeaveParticipants(user, 4); } @Test @DisplayName("Massive session") - @Disabled void massiveSessionTest() throws Exception { OpenViduTestappUser user = setupBrowserAndConnectToOpenViduTestapp("chrome"); log.info("Massive session"); - final Integer NUMBER_OF_USERS = 7; + final Integer NUMBER_OF_USERS = 8; user.getDriver().findElement(By.id("toolbar-scenarios")).sendKeys(Keys.ENTER); - WebElement one2ManyInput = user.getDriver().findElement(By.id("one2many-input")); - one2ManyInput.clear(); - one2ManyInput.sendKeys(NUMBER_OF_USERS.toString()); + WebElement many2ManyInput = user.getDriver().findElement(By.id("m2m-input")); + many2ManyInput.clear(); + many2ManyInput.sendKeys(NUMBER_OF_USERS.toString()); - user.getDriver().findElement(By.id("one2many-btn")).click(); + user.getDriver().findElement(By.id("m2m-btn")).click(); + + user.getEventManager().waitUntilEventReaches("signalConnected", "RoomEvent", NUMBER_OF_USERS); + user.getEventManager().waitUntilEventReaches("connected", "RoomEvent", NUMBER_OF_USERS); + user.getEventManager().waitUntilEventReaches("localTrackPublished", "RoomEvent", NUMBER_OF_USERS * 2); + user.getEventManager().waitUntilEventReaches("trackPublished", "RoomEvent", + (NUMBER_OF_USERS) * (NUMBER_OF_USERS - 1) * 2); + user.getEventManager().waitUntilEventReaches("trackSubscribed", "RoomEvent", + (NUMBER_OF_USERS) * (NUMBER_OF_USERS - 1) * 2); user.getWaiter() .until(ExpectedConditions.numberOfElementsToBe(By.tagName("video"), NUMBER_OF_USERS * NUMBER_OF_USERS)); + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("video", true, true), + "HTMLVideoElements were expected to have a video track and an audio track attached"); - user.getEventManager().waitUntilEventReaches("streamCreated", "RoomEvent", NUMBER_OF_USERS * NUMBER_OF_USERS); - user.getEventManager().waitUntilEventReaches("streamPlaying", "RoomEvent", NUMBER_OF_USERS * NUMBER_OF_USERS); - - this.stopMediaServer(); + user.getDriver().findElement(By.id("finish-btn")).click(); - user.getEventManager().waitUntilEventReaches("sessionDisconnected", "RoomEvent", NUMBER_OF_USERS); + user.getEventManager().waitUntilEventReaches("disconnected", "RoomEvent", NUMBER_OF_USERS); } @Test @@ -315,14 +325,9 @@ public void uncaughtException(Thread th, Throwable ex) { Assertions.assertEquals(3, numberOfVideos, "Wrong number of videos"); Assertions.assertEquals(3, numberOfAudios, "Wrong number of audios"); - Assertions - .assertTrue( - user.getBrowserUser().assertMediaTracks( - user.getDriver().findElements(By.tagName("video")), false, true), - "HTMLVideoElements were expected to have only one video track"); - Assertions.assertTrue( - user.getBrowserUser().assertMediaTracks( - user.getDriver().findElements(By.cssSelector("audio.remote")), true, false), + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("video", false, true), + "HTMLVideoElements were expected to have only one video track"); + Assertions.assertTrue(user.getBrowserUser().assertAllElementsHaveTracks("audio.remote", true, false), "HTMLAudioElements were expected to have only one audio track"); latch.countDown(); diff --git a/openvidu-testapp/package-lock.json b/openvidu-testapp/package-lock.json index b90bf0f521..8649df12e2 100644 --- a/openvidu-testapp/package-lock.json +++ b/openvidu-testapp/package-lock.json @@ -63,13 +63,13 @@ } }, "node_modules/@angular-devkit/architect": { - "version": "0.1602.15", - "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1602.15.tgz", - "integrity": "sha512-+yPlUG5c8l7Z/A6dyeV7NQjj4WDWnWWQt+8eW/KInwVwoYiM32ntTJ0M4uU/aDdHuwKQnMLly28AcSWPWKYf2Q==", + "version": "0.1602.16", + "resolved": "https://registry.npmjs.org/@angular-devkit/architect/-/architect-0.1602.16.tgz", + "integrity": "sha512-aWEeGU4UlbrSKpcAZsldVNxNXAWEeu9hM2BPk77GftbRC8PBMWpgYyrJWTz2ryn8aSmGKT3T8OyBH4gZA/667w==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/core": "16.2.15", + "@angular-devkit/core": "16.2.16", "rxjs": "7.8.1" }, "engines": { @@ -79,16 +79,16 @@ } }, "node_modules/@angular-devkit/build-angular": { - "version": "16.2.15", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-16.2.15.tgz", - "integrity": "sha512-gw9wQENYVNUCB2bnzk0yKd6YGlemDwuwKnrPnSm4myyMuScZpW+e+zliGW+JXRuVWZqiTJNcdd58e4CrrreILg==", + "version": "16.2.16", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-angular/-/build-angular-16.2.16.tgz", + "integrity": "sha512-gEni21kza41xaRnVWP1sMuiWHS/rdoym5FEEGDo9PG60LwRC4lekIgT09GpTlmMu007UEfo0ccQnGroD6+MqWg==", "dev": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "2.2.1", - "@angular-devkit/architect": "0.1602.15", - "@angular-devkit/build-webpack": "0.1602.15", - "@angular-devkit/core": "16.2.15", + "@angular-devkit/architect": "0.1602.16", + "@angular-devkit/build-webpack": "0.1602.16", + "@angular-devkit/core": "16.2.16", "@babel/core": "7.22.9", "@babel/generator": "7.22.9", "@babel/helper-annotate-as-pure": "7.22.5", @@ -100,7 +100,7 @@ "@babel/runtime": "7.22.6", "@babel/template": "7.22.5", "@discoveryjs/json-ext": "0.5.7", - "@ngtools/webpack": "16.2.15", + "@ngtools/webpack": "16.2.16", "@vitejs/plugin-basic-ssl": "1.0.1", "ansi-colors": "4.1.3", "autoprefixer": "10.4.14", @@ -143,7 +143,7 @@ "text-table": "0.2.0", "tree-kill": "1.2.2", "tslib": "2.6.1", - "vite": "4.5.3", + "vite": "4.5.5", "webpack": "5.94.0", "webpack-dev-middleware": "6.1.2", "webpack-dev-server": "4.15.1", @@ -209,13 +209,13 @@ "license": "0BSD" }, "node_modules/@angular-devkit/build-webpack": { - "version": "0.1602.15", - "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1602.15.tgz", - "integrity": "sha512-ms1+vCDdV0KX8BplJ7JoKH3wKjWHxxZTOX+mSPIjt4wS1uAk5DnezXHIjpBiJ3HY9XVHFI9C0HT4n7o6kFIOEQ==", + "version": "0.1602.16", + "resolved": "https://registry.npmjs.org/@angular-devkit/build-webpack/-/build-webpack-0.1602.16.tgz", + "integrity": "sha512-b99Sj0btI0C2GIfzoyP8epDMIOLqSTqXOxw6klGtBLaGZfM5KAxqFzekXh8cAnHxWCj20WdNhezS1eUTLOkaIA==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/architect": "0.1602.15", + "@angular-devkit/architect": "0.1602.16", "rxjs": "7.8.1" }, "engines": { @@ -229,9 +229,9 @@ } }, "node_modules/@angular-devkit/core": { - "version": "16.2.15", - "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.2.15.tgz", - "integrity": "sha512-68BgPWpcjNKz++uvLFG8IZaOH3ti2BWQVqaE3yTIYaMoNt0y0A0X2MUVd7EGbAGUk2JdloWJv5LTPVZMzCuK4w==", + "version": "16.2.16", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-16.2.16.tgz", + "integrity": "sha512-5xHs9JFmp78sydrOAg0UGErxfMVv5c2f3RXoikS7eBOOXTWEi5pmnOkOvSJ3loQFGVs3Y7i+u02G3VrF5ZxOrA==", "dev": true, "license": "MIT", "dependencies": { @@ -257,13 +257,13 @@ } }, "node_modules/@angular-devkit/schematics": { - "version": "16.2.15", - "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.2.15.tgz", - "integrity": "sha512-C/j2EwapdBMf1HWDuH89bA9B2e511iEYImkyZ+vCSXRwGiWUaZCrhl18bvztpErTrdOLM3mCwNXWEAMXI4zUXA==", + "version": "16.2.16", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-16.2.16.tgz", + "integrity": "sha512-pF6fdtJh6yLmgA7Gs45JIdxPl2MsTAhYcZIMrX1a6ID64dfwtF0MP8fDE6vrWInV1zXbzzf7l7PeKuqVtTSzKg==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/core": "16.2.15", + "@angular-devkit/core": "16.2.16", "jsonc-parser": "3.2.0", "magic-string": "0.30.1", "ora": "5.4.1", @@ -308,16 +308,16 @@ } }, "node_modules/@angular/cli": { - "version": "16.2.15", - "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-16.2.15.tgz", - "integrity": "sha512-nNUmt0ZRj2xHH8tGXSJUiusP5rmakAz0f6cc6T4p03OyeShOKdvs9+/F4hzzsM79/ylZofBlFfwYVCBTbOtMqw==", + "version": "16.2.16", + "resolved": "https://registry.npmjs.org/@angular/cli/-/cli-16.2.16.tgz", + "integrity": "sha512-aqfNYZ45ndrf36i+7AhQ9R8BCm025j7TtYaUmvvjT4LwiUg6f6KtlZPB/ivBlXmd1g9oXqW4advL0AIi8A/Ozg==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/architect": "0.1602.15", - "@angular-devkit/core": "16.2.15", - "@angular-devkit/schematics": "16.2.15", - "@schematics/angular": "16.2.15", + "@angular-devkit/architect": "0.1602.16", + "@angular-devkit/core": "16.2.16", + "@angular-devkit/schematics": "16.2.16", + "@schematics/angular": "16.2.16", "@yarnpkg/lockfile": "1.1.0", "ansi-colors": "4.1.3", "ini": "4.1.1", @@ -4051,9 +4051,9 @@ } }, "node_modules/@ngtools/webpack": { - "version": "16.2.15", - "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.2.15.tgz", - "integrity": "sha512-rD4IHt3nS6PdIKvmoqwIadMIGKsemBSz412kD8Deetl0TiCVhD/Tn1M00dxXzMSHSFCQcOKxdZAeD53yRwTOOA==", + "version": "16.2.16", + "resolved": "https://registry.npmjs.org/@ngtools/webpack/-/webpack-16.2.16.tgz", + "integrity": "sha512-4gm2allK0Pjy/Lxb9IGRnhEZNEOJSOTWwy09VOdHouV2ODRK7Tto2LgteaFJUUSLkuvWRsI7pfuA6yrz8KDfHw==", "dev": true, "license": "MIT", "engines": { @@ -4293,14 +4293,14 @@ } }, "node_modules/@schematics/angular": { - "version": "16.2.15", - "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.2.15.tgz", - "integrity": "sha512-T7wEGYxidpLAkis+hO5nsVfnWsy6sXf1T9GS8uztC8IYYsnqB9jTVfjVyfhASugZasdmx7+jWv3oCGy6Z5ZehA==", + "version": "16.2.16", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-16.2.16.tgz", + "integrity": "sha512-V4cE4R5MbusKaNW9DWsisiSRUoQzbAaBIeJh42yCkg5H/lUdf18hUB7DG6Pl7yH6/tjzzz4SqIVD7N64uCDC2A==", "dev": true, "license": "MIT", "dependencies": { - "@angular-devkit/core": "16.2.15", - "@angular-devkit/schematics": "16.2.15", + "@angular-devkit/core": "16.2.16", + "@angular-devkit/schematics": "16.2.16", "jsonc-parser": "3.2.0" }, "engines": { @@ -4578,9 +4578,9 @@ } }, "node_modules/@types/estree": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.5.tgz", - "integrity": "sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.6.tgz", + "integrity": "sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==", "dev": true, "license": "MIT" }, @@ -4656,9 +4656,9 @@ "license": "MIT" }, "node_modules/@types/lodash": { - "version": "4.17.7", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.7.tgz", - "integrity": "sha512-8wTvZawATi/lsmNu10/j2hk1KEP0IvjubqPE3cu1Xz7xfXXt5oCq3SNUz4fMIP4XGF9Ky+Ue2tBA3hcS7LSBlA==", + "version": "4.17.9", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.9.tgz", + "integrity": "sha512-w9iWudx1XWOHW5lQRS9iKpK/XuRhnN+0T7HvdCCd802FYkT1AMTnxndJHGrNJwRoRHkslGr4S29tjm1cT7x/7w==", "dev": true, "license": "MIT" }, @@ -6128,9 +6128,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001660", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001660.tgz", - "integrity": "sha512-GacvNTTuATm26qC74pt+ad1fW15mlQ/zuTzzY1ZoIzECTP8HURDfF43kNxPgf7H1jmelCBQTTbBNxdSXOA7Bqg==", + "version": "1.0.30001663", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001663.tgz", + "integrity": "sha512-o9C3X27GLKbLeTYZ6HBOLU1tsAcBZsLis28wrVzddShCS16RujjHp9GDHKZqrB3meE0YjhawvMFsGb/igqiPzA==", "dev": true, "funding": [ { @@ -7288,9 +7288,9 @@ "license": "MIT" }, "node_modules/electron-to-chromium": { - "version": "1.5.23", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.23.tgz", - "integrity": "sha512-mBhODedOXg4v5QWwl21DjM5amzjmI1zw9EPrPK/5Wx7C8jt33bpZNrC7OhHUG3pxRtbLpr3W2dXT+Ph1SsfRZA==", + "version": "1.5.27", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.27.tgz", + "integrity": "sha512-o37j1vZqCoEgBuWWXLHQgTN/KDKe7zwpiY5CPeq2RvUqOyJw9xnrULzZAEVQ5p4h+zjMk7hgtOoPdnLxr7m/jw==", "dev": true, "license": "ISC" }, @@ -7368,9 +7368,9 @@ } }, "node_modules/engine.io": { - "version": "6.5.5", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.5.5.tgz", - "integrity": "sha512-C5Pn8Wk+1vKBoHghJODM63yk8MvrO9EWZUfkAt5HAqIgPE4/8FF0PEGHXtEd40l223+cE5ABWuPzm38PHFXfMA==", + "version": "6.6.1", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.6.1.tgz", + "integrity": "sha512-NEpDCw9hrvBW+hVEOK4T7v0jFJ++KgtPl4jKFwsZVfG1XhS0dCrSb3VMb9gPAd7VAdW52VT1EnaNiU2vM8C0og==", "dev": true, "license": "MIT", "dependencies": { @@ -9635,9 +9635,9 @@ } }, "node_modules/jose": { - "version": "5.9.2", - "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.2.tgz", - "integrity": "sha512-ILI2xx/I57b20sd7rHZvgiiQrmp2mcotwsAH+5ajbpFQbrYVQdNHYlQhoA5cFb78CgtBOxtC05TeA+mcgkuCqQ==", + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.3.tgz", + "integrity": "sha512-egLIoYSpcd+QUF+UHgobt5YzI2Pkw/H39ou9suW687MY6PmCwPmkNV/4TNjn1p2tX5xO3j0d0sq5hiYE24bSlg==", "license": "MIT", "funding": { "url": "https://github.com/sponsors/panva" @@ -13031,9 +13031,9 @@ } }, "node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", + "version": "3.29.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.5.tgz", + "integrity": "sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==", "dev": true, "license": "MIT", "bin": { @@ -13720,9 +13720,9 @@ } }, "node_modules/socket.io": { - "version": "4.7.5", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.7.5.tgz", - "integrity": "sha512-DmeAkF6cwM9jSfmp6Dr/5/mfMwb5Z5qRrSXLpo3Fq5SqyU8CMF15jIN4ZhfSwu35ksM1qmHZDQ/DK5XTccSTvA==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.8.0.tgz", + "integrity": "sha512-8U6BEgGjQOfGz3HHTYaC/L1GaxDCJ/KM0XTkJly0EhZ5U/du9uNEZy4ZgYzEzIqlx2CMm25CrCqr1ck899eLNA==", "dev": true, "license": "MIT", "dependencies": { @@ -13730,7 +13730,7 @@ "base64id": "~2.0.0", "cors": "~2.8.5", "debug": "~4.3.2", - "engine.io": "~6.5.2", + "engine.io": "~6.6.0", "socket.io-adapter": "~2.5.2", "socket.io-parser": "~4.2.4" }, @@ -14373,9 +14373,9 @@ } }, "node_modules/terser-webpack-plugin/node_modules/terser": { - "version": "5.32.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.32.0.tgz", - "integrity": "sha512-v3Gtw3IzpBJ0ugkxEX8U0W6+TnPKRRCWGh1jC/iM/e3Ki5+qvO1L1EAZ56bZasc64aXHwRHNIQEzm6//i5cemQ==", + "version": "5.33.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.33.0.tgz", + "integrity": "sha512-JuPVaB7s1gdFKPKTelwUyRq5Sid2A3Gko2S0PncwdBq7kN9Ti9HPWDQ06MPsEDGsZeVESjKEnyGy68quBk1w6g==", "dev": true, "license": "BSD-2-Clause", "dependencies": { @@ -14973,9 +14973,9 @@ } }, "node_modules/vite": { - "version": "4.5.3", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.3.tgz", - "integrity": "sha512-kQL23kMeX92v3ph7IauVkXkikdDRsYMGTVl5KY2E9OY4ONLvkHf04MDTbnfo6NKxZiDLWzVpP5oTa8hQD8U3dg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/vite/-/vite-4.5.5.tgz", + "integrity": "sha512-ifW3Lb2sMdX+WU91s3R0FyQlAyLxOzCSCP37ujw0+r5POeHPwe6udWVIElKQq8gk3t7b8rkmvqC6IHBpCff4GQ==", "dev": true, "license": "MIT", "dependencies": { diff --git a/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.html b/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.html index 15c36c19b6..22418d2aa9 100644 --- a/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.html +++ b/openvidu-testapp/src/app/components/dialogs/options-dialog/options-dialog.component.html @@ -15,9 +15,9 @@

OPTIONS

VideoCaptureOptions - True (default) - False (no video) - Custom + True (default) + False (no video) + Custom
@@ -43,9 +43,9 @@

OPTIONS

- True (default) - False (no audio) - Custom + True (default) + False (no audio) + Custom
diff --git a/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts b/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts index ea45de5fea..d61e7a24f9 100644 --- a/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts +++ b/openvidu-testapp/src/app/components/test-scenarios/test-scenarios.component.ts @@ -1,7 +1,10 @@ import { Component, OnDestroy, OnInit } from '@angular/core'; import { Subscription } from 'rxjs'; -import { TestFeedService } from '../../services/test-feed.service'; +import { + TestAppEvent, + TestFeedService, +} from '../../services/test-feed.service'; import { CreateLocalTracksOptions, @@ -15,6 +18,9 @@ import { RoomOptions, LocalTrack, TrackPublishOptions, + ParticipantEvent, + LocalTrackPublication, + RemoteTrack, } from 'livekit-client'; import { LivekitParamsService } from 'src/app/services/livekit-params.service'; import { RoomApiService } from 'src/app/services/room-api.service'; @@ -60,12 +66,12 @@ export class TestScenariosComponent implements OnInit, OnDestroy { createLocalTracksOptions: CreateLocalTracksOptions = { video: { resolution: { - frameRate: 1, - height: 30, - width: 40, + frameRate: 6, + height: 144, + width: 256, }, }, - audio: false, + audio: true, }; trackPublishOptions: TrackPublishOptions; @@ -156,6 +162,16 @@ export class TestScenariosComponent implements OnInit, OnDestroy { } } + private updateEventList(eventType: RoomEvent) { + const event: TestAppEvent = { + eventType, + eventCategory: 'RoomEvent', + eventContent: {}, + eventDescription: '', + }; + this.testFeedService.pushNewEvent({ user: 0, event }); + } + private async startSession() { let promises = []; let i = -1; @@ -174,7 +190,12 @@ export class TestScenariosComponent implements OnInit, OnDestroy { ); const room: Room = user.room; - room!.on(RoomEvent.Connected, () => { + room.on(RoomEvent.SignalConnected, () => { + this.updateEventList(RoomEvent.SignalConnected); + }); + + room.on(RoomEvent.Connected, () => { + this.updateEventList(RoomEvent.Connected); room.remoteParticipants.forEach( (remoteParticipant: RemoteParticipant) => { if (user.subscriber) { @@ -189,9 +210,18 @@ export class TestScenariosComponent implements OnInit, OnDestroy { ); }); + room.on(RoomEvent.ParticipantConnected, () => { + this.updateEventList(RoomEvent.ParticipantConnected); + }); + + room.on(RoomEvent.ParticipantConnected, () => { + this.updateEventList(RoomEvent.ParticipantConnected); + }); + room.on( RoomEvent.TrackPublished, (publication: RemoteTrackPublication) => { + this.updateEventList(RoomEvent.TrackPublished); if (user.subscriber) { // Subscribe to new tracks publication.setSubscribed(true); @@ -199,6 +229,18 @@ export class TestScenariosComponent implements OnInit, OnDestroy { } ); + room.on(RoomEvent.LocalTrackPublished, () => { + this.updateEventList(RoomEvent.LocalTrackPublished); + }); + + room.on(RoomEvent.TrackSubscribed, () => { + this.updateEventList(RoomEvent.TrackSubscribed); + }); + + room.on(RoomEvent.Disconnected, () => { + this.updateEventList(RoomEvent.Disconnected); + }); + await room.connect( this.livekitParamsService.getParams().livekitUrl, token,