diff --git a/src/resources/js/meet/app.js b/src/resources/js/meet/app.js --- a/src/resources/js/meet/app.js +++ b/src/resources/js/meet/app.js @@ -820,10 +820,19 @@ update() }) - // TODO: Here the user is asked for media permissions again - // should we rather start the stream without asking the user? - // Or maybe we want to display the media setup/preview form? - // Need to find a way to do this. + // Open the media setup dialog + // Note: If user didn't give permission to media before joining the room + // he will not be able to use them now. Changing permissions requires + // a page refresh. + // Note: In Firefox I'm always being asked again for media permissions. + // It does not happen in Chrome. In Chrome the cam/mic will be just re-used. + // I.e. streaming starts automatically. + // It might make sense to not start streaming automatically in any cirmustances, + // display the dialog and wait until user closes it, but this would be + // a bigger refactoring. + if (sessionData.onMediaSetup) { + sessionData.onMediaSetup() + } } else { // Inform the vue component, so it can update some UI controls update() diff --git a/src/tests/Browser/Meet/RoomSetupTest.php b/src/tests/Browser/Meet/RoomSetupTest.php --- a/src/tests/Browser/Meet/RoomSetupTest.php +++ b/src/tests/Browser/Meet/RoomSetupTest.php @@ -456,6 +456,10 @@ ->assertElementsCount('@session div.meet-subscriber', 0); $guest1 + ->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { + $browser->assertSeeIn('@title', 'Media setup') + ->click('@button-action'); + }) ->waitFor('@session .meet-video.self') ->assertElementsCount('@session div.meet-video', 2) ->assertElementsCount('@session video', 2) @@ -486,6 +490,10 @@ ->waitUntilMissing('.dropdown-menu'); }) ->waitUntilMissing('@session .meet-subscriber.self') + ->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { + $browser->assertSeeIn('@title', 'Media setup') + ->click('@button-action'); + }) ->waitFor('@session div.meet-video.self') ->assertElementsCount('@session div.meet-video', 2) ->assertElementsCount('@session video', 2)