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
room name and user name as GET parameters #95
Conversation
…r to the passcode
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.
Great addition @leesalminen ! Thank you for submitting. I left a few comments/questions.
Can you also please write tests for your changes? Thanks!
@@ -23,6 +23,7 @@ | |||
"lint-staged": "^9.5.0", | |||
"lodash.throttle": "^4.1.1", | |||
"prettier": "^1.19.1", | |||
"query-string": "^6.11.1", |
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.
This should've updated the package-lock.json
. Can you please push up the changes?
@@ -1,9 +1,22 @@ | |||
import { useCallback, useEffect, useState } from 'react'; | |||
import { useHistory } from 'react-router-dom'; | |||
const queryString = require('query-string'); |
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 we use import
here?
const parsed = queryString.parse(window.location.search); | ||
const user = parsed.user ? parsed.user : window.sessionStorage.getItem('user'); | ||
return user; | ||
} |
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 we are sharing this url, I would expect we want the user to enter their own username. Why are we setting it in the url? Can you please provide the use case for this?
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.
@charliesantos there are a few use-cases where prefilling a user's name could be useful.
For example, I click a button to send an SMS link to the video room. The button trigger's a controller that queries by DB based on the phone entered and pulls the first name based on the phone number. Then, the controller adds that param to the link and sends an SMS -> user has a one-click join experience.
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.
That's a good use case @cweems. In that case, I think we can keep this feature in this PR.
Our use case is similar. We wanted to add a button to our application that
when clicked provided an instant join experience to a room. Our application
already knows what room to join and the user’s name.
I see your other notes on the code. I should have some time this weekend to
review.
On Fri, Mar 20, 2020 at 3:45 PM Charlemagne Santos ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/state/usePasscodeAuth/usePasscodeAuth.ts
<#95 (comment)>
:
> @@ -1,9 +1,22 @@
import { useCallback, useEffect, useState } from 'react';
import { useHistory } from 'react-router-dom';
+const queryString = require('query-string');
+
+export function getRoomName() {
+ const parsed = queryString.parse(window.location.search);
+ const room = parsed.room ? parsed.room : window.sessionStorage.getItem('room');
+ return room;
+}
+
+export function getUserName() {
+ const parsed = queryString.parse(window.location.search);
+ const user = parsed.user ? parsed.user : window.sessionStorage.getItem('user');
+ return user;
+}
That's a good use case @cweems <https://github.com/cweems>. In that case,
I think we can keep this feature in this PR.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAXA4572Z5LGIFVWFGWXA4DRIPPYDANCNFSM4LOWNIOQ>
.
--
Lee Salminen
“A ship is always safe on the shore, but that’s not what ships are for.”
-Albert Einstein
|
This feature (passing user/room) as coded in this PR doesn't work if you don't use passcode auth correct? |
Heads up, based on my testing locally of this feature, using auto connect in Safari will break the Audio (No audio track) |
@leesalminen @saulm I made a PR on top of Lee's that adds the ability to accept URL params without passcode auth: leesalminen#1 I was also able to reproduce the Safari issue, but I don't understand what's causing it. Is there some Safari specific behavior that prevents audio and video access without a form submit? |
Thanks for the PR @leesalminen Some thoughts:
To summarize, I think it's fine to populate the user's name and room name via query parameters, but I don't think it's a good idea to add the auto-join feature. @leesalminen, would this PR still meet your use case if the auto-join feature is removed? |
I'm not sure about for @leesalminen but I can comment on my use case. We have a similar situation where we are creating a shareable link for job-seekers to join a two way interview. We already have the job seekers name, so it's nice being able to prepopulate that for them. I actually prefer still having some sort of preview room so they can make sure everything looks nice and is working before joining the interview. |
In our use case, we found it was sufficient enough to have users join the "waiting room" with standard GET parameters: This saves us from the issues @timmydoza mentioned above, namely the browser's requirement for user interaction before |
I think the uses cases that @RusseII and @imjared explain are good ones. I agree with having a 'waiting room' or a 'preview room'. I can go ahead and wrap up this PR to implement the feature. One question that I have: If the user's identity and room name are supplied with query parameters, then should the 'Name' and 'Room' text fields still be editable by the user? |
Good question. For our use case, I left them editable though I don't know why a user would want to edit them and I could certainly see a use case where the provider might want to obscure that functionality with something like simply having a "ready to join?" button. |
For our use case - We actually hide the room name.
The user-name being editable doesn't really matter one way or the other to
us.
We will probably do what @imjared mentioned and obscure the name box with
something like a "ready to join" button.
…On Wed, Apr 22, 2020 at 6:35 PM timmydoza ***@***.***> wrote:
I think the uses cases that @RusseII <https://github.com/RusseII> and
@imjared <https://github.com/imjared> explain are good ones. I agree with
having a 'waiting room' or a 'preview room'.
I can go ahead and wrap up this PR to implement the feature. One question
that I have: If the user's identity and room name are supplied with query
parameters, then should the 'Name' and 'Room' text fields still be editable
by the user?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#95 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADSXBSX4ODZEVN3DMYPA7K3RN55NRANCNFSM4LOWNIOQ>
.
|
URLRoomName = window.sessionStorage.getItem('room') || ''; | ||
} | ||
|
||
const URLUserName = window.sessionStorage.getItem('user') || ''; |
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.
should this come from useParams()
the same way that URLRoomName
does?
Thanks for the discussion @RusseII, @imjared! Given that each use case may vary a little bit, is seems that it may be tricky to implement a one-size-fits-all solution. It also sounds like a simple feature to implement, and that you both have already done so. Given all this, (in addition to the fact that we haven't heard from the original author @leesalminen in a while) I'm leaning towards closing this PR. Any objections? |
@timmydoza honestly you all have made this thing so easy to customize that i think it's fine if it's left to the user to add the took me all of like 10 mins after cloning to figure out how to run it and start making changes |
Sounds good @imjared! I appreciate the feedback! I'll close this PR then. |
@timmydoza I'm a bit late to the party but I agree with everything @imjared said |
This feature allows users to pass in the room name and user name as GET parameters to the application. This enables
<iframe>
embeds as well as easier link sharing to get multiple participants into the same room.Example URL: https://video-app-XXXX-dev.twil.io/?passcode=NNNNNNNNN&room=my-room&user=admin
I know that the room name can be passed in via URL route, however this does not work when deployed to Twilio Functions API infrastructure.
Contributing to Twilio
Burndown
Before review
npm test
Before merge