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

Grid mode #651

Merged
merged 22 commits into from
Mar 8, 2022
Merged

Grid mode #651

merged 22 commits into from
Mar 8, 2022

Conversation

timmydoza
Copy link
Contributor

@timmydoza timmydoza commented Mar 2, 2022

Contributing to Twilio

All third party contributors acknowledge that any contributions they provide will be made under the same open source license that the open source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

Pull Request Details

JIRA link(s):

Description

This PR add a basic Grid Mode to the app. In this mode, participants will be rendered in an adaptive grid format, with a maximum of 25 participants (for now).

grid

To try the grid mode, you can just use the app with many participants, or you can run npm run storybook to try out the app in a mocked video room.

More changes:

  • Update Typescript version so we can get the type definition for the ResizeObserver
  • Fix index.html caching issue in the server

Burndown

Before review

  • Updated CHANGELOG.md if necessary
  • Added unit tests if necessary
  • Updated affected documentation
  • Verified locally with npm test
  • Manually sanity tested running locally
  • Included screenshot as PR comment (if needed)
  • Ready for review

Before merge

  • Got one or more +1s
  • Re-tested if necessary

@timmydoza timmydoza requested a review from olipyskoty March 2, 2022 20:38
Copy link
Contributor

@olipyskoty olipyskoty left a comment

Choose a reason for hiding this comment

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

I think this looks really good! Excited to have this implemented.

I left a couple of questions about some comments/logs that might be able to be removed. And also a question about leaving a comment for participants' audio tracks. Just curious to hear your thoughts.

Also, are we going to be mimicking the dominant speaker behavior from the video composer at some point (green highlight around speaker, special ordering of participants)?

import { action } from '@storybook/addon-actions';
import EventEmitter from 'events';

// navigator.permissions = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we remove this comment or is it needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed.

if (args[0] === '/token') {
return Promise.resolve({
ok: true,
json: () => Promise.resolve({ token: 'yay' }),
Copy link
Contributor

Choose a reason for hiding this comment

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

🥳

layout: 'fullscreen',
argTypes: {
participants: {
control: { type: 'range', min: 0, max: 100, step: 1 },
Copy link
Contributor

Choose a reason for hiding this comment

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

Should max be 50? I noticed that when I run story book and have 50+ participants, I couldn't test out the dominant speaker feature for any participant > 51. Or is it because we are planning on supporting 100 participants in the future?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch! Looks like it has to do with this line here. The for loop was only processing the first 50 participants, even though the storybook slider went up to 100. I changed them both to 200.

@@ -63,7 +63,7 @@ export default function useLocalTracks() {
if (isAcquiringLocalTracks || audioTrack || videoTrack) return Promise.resolve();

setIsAcquiringLocalTracks(true);

console.log(3);
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this log?

return (
<div
className={clsx(classes.container, {
[classes.rightDrawerOpen]: isChatWindowOpen || isBackgroundSelectionOpen,
})}
>
<MainParticipant />
<ParticipantList />
<ParticipantAudioTracks />
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if we should have a comment explaining <ParticipantAudioTracks /> and why it is necessary for grid mode? I see you left one in Publication.tsx but I'm wondering if others will be confused as to why audio tracks aren't treated the same was as video tracks. Just a thought 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea! I added a comment.

@timmydoza timmydoza changed the title Large rooms grid Grid mode Mar 8, 2022
@timmydoza timmydoza changed the base branch from feature/large-rooms to feature/grid-mode March 8, 2022 06:24
@timmydoza
Copy link
Contributor Author

Also, are we going to be mimicking the dominant speaker behavior from the video composer at some point (green highlight around speaker, special ordering of participants)?

Good question! Yes, but there's another ticket for that. For now, the Grid Mode is using the same dominant speaker behavior as the Collaboration Mode - which isn't ideal, but it's good enough for now. After this we'll make the Grid Mode dominant speaker work the same as the Video Componser.

@timmydoza timmydoza requested a review from olipyskoty March 8, 2022 06:42
Copy link
Contributor

@olipyskoty olipyskoty left a comment

Choose a reason for hiding this comment

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

Looking good!

@timmydoza timmydoza merged commit 138756c into feature/grid-mode Mar 8, 2022
@timmydoza timmydoza deleted the large-rooms-grid branch March 8, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants