-
Notifications
You must be signed in to change notification settings - Fork 509
Send media streams in calls only by moderators #3222
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
Changes from all commits
27303ba
027eba8
a3ccb92
792c44d
34df760
4483efd
e6544a9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,7 +19,7 @@ | |
| --> | ||
|
|
||
| <template> | ||
| <div v-show="!placeholderForPromoted || sharedData.promoted" | ||
| <div v-show="isSendingMediaOrScreensharingAllowed && (!placeholderForPromoted || sharedData.promoted)" | ||
| :id="(placeholderForPromoted ? 'placeholder-' : '') + 'container_' + model.attributes.peerId + '_video_incoming'" | ||
| class="videoContainer" | ||
| :class="containerClass"> | ||
|
|
@@ -159,16 +159,49 @@ export default { | |
| return participantName | ||
| }, | ||
|
|
||
| currentParticipant() { | ||
| participant() { | ||
| if (typeof this.token === 'undefined') { | ||
| return { | ||
| participantType: undefined, | ||
| } | ||
| } | ||
|
|
||
| if (!this.model.attributes.userId) { | ||
| return { | ||
| // The participant might be a GUEST_MODERATOR, but | ||
| // unfortunately it is not possible to know it. | ||
| participantType: PARTICIPANT.TYPE.GUEST, | ||
| } | ||
| } | ||
|
|
||
| const participantIndex = this.$store.getters.getParticipantIndex(this.token, { participant: this.model.attributes.userId }) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we have a participant mixin, not sure if we can use it or extend it ? |
||
| if (participantIndex !== -1) { | ||
| return this.$store.getters.getParticipant(this.token, participantIndex) | ||
| } | ||
|
|
||
| return { | ||
| participantType: undefined, | ||
| } | ||
| }, | ||
|
|
||
| isSendingMediaOrScreensharingAllowed() { | ||
| return this.participant.participantType === PARTICIPANT.TYPE.OWNER | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. deja vu I wonder if we should move this to a property and let the callview do this check and tell all sub-components what's allowed or not ? |
||
| || this.participant.participantType === PARTICIPANT.TYPE.MODERATOR | ||
| || this.conversation.objectType === 'share:password' | ||
| || this.conversation.objectType === 'file' | ||
| }, | ||
|
|
||
| conversation() { | ||
| return this.$store.getters.conversations[this.token] || { | ||
| sessionId: '0', | ||
| participantType: this.$store.getters.getUserId() !== null ? PARTICIPANT.TYPE.USER : PARTICIPANT.TYPE.GUEST, | ||
| objectType: null, | ||
| } | ||
| }, | ||
|
|
||
| selfIsModerator() { | ||
| return this.currentParticipant.participantType === PARTICIPANT.TYPE.OWNER | ||
| || this.currentParticipant.participantType === PARTICIPANT.TYPE.MODERATOR | ||
| return this.conversation.participantType === PARTICIPANT.TYPE.OWNER | ||
| || this.conversation.participantType === PARTICIPANT.TYPE.MODERATOR | ||
| }, | ||
|
|
||
| connectionStateFailedNoRestart() { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -26,13 +26,21 @@ import { joinCall as webRtcJoinCall, getSignaling } from '../utils/webrtc/index' | |
|
|
||
| /** | ||
| * Join a call as participant | ||
| * | ||
| * The flags constrain the media to send when joining the call. If no flags are | ||
| * provided both audio and video are available. Otherwise only the specified | ||
| * media will be allowed to be sent. | ||
| * | ||
| * Note that the flags are constraints, but not requeriments. Only the specified | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo "requeriments" |
||
| * media is allowed to be sent, but it is not guaranteed to be sent. For | ||
| * example, if WITH_VIDEO is provided but the device does not have a camera. | ||
| * | ||
| * @param {string} token The token of the call to be joined. | ||
| * @param {int} flags The available PARTICIPANT.CALL_FLAG for this participants | ||
| */ | ||
| const joinCall = async function(token, flags) { | ||
| try { | ||
| // FIXME flags is ignored? | ||
| await webRtcJoinCall(token) | ||
| await webRtcJoinCall(token, flags) | ||
| } catch (error) { | ||
| console.debug('Error while joining call: ', error) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -102,6 +102,27 @@ const actions = { | |
| if (!currentUser.uid) { | ||
| currentUser = getCurrentUser() | ||
| } | ||
|
|
||
| if (!currentUser || !currentUser.uid) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add comment to clarify that for guest users we need to explicitly fetch the list (the if statement isn't very clear that we're targetting guests) |
||
| // Guests can not fetch the full participant list, but at least the | ||
| // participants store can be populated with the user ID, session ID, | ||
| // participant type and call status of the users from the | ||
| // conversation data. | ||
| context.dispatch('purgeParticipantsStore', conversation.token) | ||
|
|
||
| for (const participantId in conversation.participants) { | ||
| context.dispatch('addParticipant', { | ||
| token: conversation.token, | ||
| participant: { | ||
| inCall: conversation.participants[participantId].call, | ||
| sessionId: conversation.participants[participantId].sessionId, | ||
| participantType: conversation.participants[participantId].type, | ||
| userId: participantId, | ||
| }, | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| context.dispatch('addParticipantOnce', { | ||
| token: conversation.token, | ||
| participant: { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.