-
Notifications
You must be signed in to change notification settings - Fork 729
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 use sdk v3 #677
base: master
Are you sure you want to change the base?
Grid mode use sdk v3 #677
Conversation
* Install storybook and add basic files * Get storybook working * Get grid view working * Hook up menu button * Fix some issues * Fix index.html caching issue * Update publication component and tests * Update Room tests * Update constants * Upgrade typescript * Update menu tests * Update TS things for new version * Rename state variable * Add test for ParticipantAudioTracks * Remove unused passcode stuff from twilio mock * Automatically disable conversations in storybook * Fix tests and linting issues * Add tests for GridView * Fix participant issue in stories * Add comment for ParticipantAudioTracks * Remove unnecessary code
* Install storybook and add basic files * Get storybook working * Get grid view working * Hook up menu button * Fix some issues * Fix index.html caching issue * Update publication component and tests * Update Room tests * Update constants * Upgrade typescript * Update menu tests * Update TS things for new version * Rename state variable * Add test for ParticipantAudioTracks * Remove unused passcode stuff from twilio mock * Automatically disable conversations in storybook * Fix tests and linting issues * Add tests for GridView * Install mui pagination component * Fix issue with storybook controls * Add pagination controls to state * Create usePagination hook * Add pagination to GridView component * Add setting for MaxGridParticipants * Remove unused constant and fix a few glitches * Add tests for usePagination * Update tests for GridView component * Fix linting issue * Only render Pagination component when there is more than one page * Display participant count in menu * Fix tests * remove console log * Fix linter errors * Fix test language * Fix issue with chat window rendering incorrectly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the suggested changes, we also need to handle audio tracks being switched off by disabling the audio level indicator and changing the mic icon.
@@ -7,16 +7,22 @@ export default function useIsTrackEnabled(track: TrackType) { | |||
const [isEnabled, setIsEnabled] = useState(track ? track.isEnabled : false); | |||
|
|||
useEffect(() => { | |||
setIsEnabled(track ? track.isEnabled : false); | |||
// @ts-ignore | |||
setIsEnabled(track?.mediaStreamTrack === null || track?.switchOffReason !== 'DisabledByPublisher'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setIsEnabled(track?.mediaStreamTrack === null || track?.switchOffReason !== 'DisabledByPublisher'); | |
setIsEnabled(track?.switchOffReason !== Track.DISABLED_BY_PUBLISHER); |
track.on('disabled', setDisabled); | ||
const handleSwitchOff = (_track: TrackType) => { | ||
// @ts-ignore | ||
if (_track.switchOffReason === 'DisabledByPublisher') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (_track.switchOffReason === 'DisabledByPublisher') { | |
if (_track.switchOffReason === Track.DISABLED_BY_PUBLISHER) { |
Thanks @manjeshbhargav! I've updated the branch to use the correct string for Also, for this:
I think this will already be handled by the changes to the |
@timmydoza We need to handle other switch off reasons as well. Either we can re-use the mic disabled icon, or we can use another icon to help us differentiate between disabled and switched off. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look good. I think we still need to add UI notification for switched off audio tracks (apart from disabled by publisher).
const handleSwitchOff = (_track: TrackType) => { | ||
// @ts-ignore | ||
if (_track.switchOffReason === 'disabled-by-publisher') { | ||
setIsEnabled(false); | ||
} | ||
}; | ||
const handleSwitchOn = () => setIsEnabled(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't this be:
const handleSwitchOff = (_track: TrackType) => { | |
// @ts-ignore | |
if (_track.switchOffReason === 'disabled-by-publisher') { | |
setIsEnabled(false); | |
} | |
}; | |
const handleSwitchOn = () => setIsEnabled(true); | |
const handleSwitchOff = (_track: TrackType) => { | |
// @ts-ignore | |
setIsEnabled(_track.switchOffReason !== 'disabled-by-publisher'); | |
}; | |
const handleSwitchOn = () => setIsEnabled(true); |
* Add useLocalStorageState hook * Fix mocked localStorage class * Add useLocalStorageState hook to app to persist settings * Add comment to useLocalStorageState hook * Update formatting
* Fix linter error * Update code formatting
* Update node version in app.yaml * Fix bug with usePresentationParticipants
Contributing to Twilio
Pull Request Details
JIRA link(s):
Description
A description of what this PR does.
Burndown
Before review
npm test
Before merge