Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-61555] Fix rendering issue with screen sharing player #899

Merged
merged 2 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
56 changes: 30 additions & 26 deletions e2e/package-lock.json

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

2 changes: 1 addition & 1 deletion e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"@babel/core": "7.20.12",
"@babel/eslint-parser": "7.19.1",
"@mattermost/types": "6.7.0-0",
"@playwright/test": "^1.40.1",
"@playwright/test": "^1.48.2",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "5.49.0",
"eslint": "8.33.0",
Expand Down
12 changes: 12 additions & 0 deletions e2e/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@
'--auto-select-desktop-capture-source="Entire screen"',
'--use-file-for-fake-audio-capture=./assets/sample.wav',
],
firefoxUserPrefs: {
'media.navigator.streams.fake': true,
'permissions.default.microphone': 1,
'permissions.default.camera': 1,
'media.navigator.permission.disabled': true,
},
},

// Unfortunately waitForFunction is flaky and randomly returns CSP failures.
Expand All @@ -46,6 +52,12 @@
{
name: 'webkit',
},
// {

Check failure on line 55 in e2e/playwright.config.ts

View workflow job for this annotation

GitHub Actions / plugin-ci / lint

Expected line before comment
// name: 'firefox',
// use: {
// browserName: 'firefox',
// },
// },
Comment on lines +57 to +62
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Keeping this commented for later?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, that's the plan

] : [
{
name: 'chromium',
Expand Down
40 changes: 40 additions & 0 deletions e2e/tests/popout.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,3 +420,43 @@ test.describe('popout window - reactions', () => {
await expect(popOut.locator('#calls-popout-emoji-picker')).toBeHidden();
});
});

test.describe('popout window - screen sharing', () => {
test.use({storageState: userStorages[0]});

test('player renders correctly', async ({page, context}) => {
const devPage = new PlaywrightDevPage(page);
await devPage.goto();
await devPage.startCall();

const [popOut] = await Promise.all([
context.waitForEvent('page'),
page.click('#calls-widget-expand-button'),
]);

await expect(popOut.locator('#calls-expanded-view')).toBeVisible();

// Verify screen player is hidden
await expect(popOut.locator('#screen-player')).toBeHidden();

// Start screen sharing
await popOut.locator('#calls-popout-screenshare-button').click();

// Verify screen player is visible
await expect(popOut.locator('#screen-player')).toBeVisible();

// Verify the player is actually showing something
const box = await popOut.locator('#screen-player').boundingBox();
expect(box?.width).toBeGreaterThan(1000);
expect(box?.height).toBeGreaterThan(500);
Comment on lines +448 to +451
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice


// Stop screen sharing
await popOut.locator('#calls-popout-screenshare-button').click();

// Verify screen player is now hidden
await expect(popOut.locator('#screen-player')).toBeHidden();

// Leave call
await devPage.leaveCall();
});
});
3 changes: 2 additions & 1 deletion webapp/src/components/expanded_view/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,10 @@ interface State {
}

const StyledMediaController = styled(MediaController)`
height: 100%;
max-height: calc(100% - 32px);
background-color: transparent;
margin-top: auto;
margin-bottom: auto;
`;

const StyledMediaControlBar = styled(MediaControlBar)`
Expand Down
Loading