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

Bring back MetadataChanged event for local participant #873

Merged
merged 2 commits into from
Sep 13, 2023
Merged
Changes from all commits
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
10 changes: 6 additions & 4 deletions src/room/participant/LocalParticipant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,21 +174,23 @@ export default class LocalParticipant extends Participant {

/**
* Sets and updates the metadata of the local participant.
* Note: this requires `canUpdateOwnMetadata` permission encoded in the token.
* The change does not take immediate effect.
* If successful, a `ParticipantEvent.MetadataChanged` event will be emitted on the local participant.
* Note: this requires `canUpdateOwnMetadata` permission.
* @param metadata
*/
setMetadata(metadata: string): void {
this.metadata = metadata;
this.engine.client.sendUpdateLocalMetadata(metadata, this.name ?? '');
}

/**
* Sets and updates the name of the local participant.
* Note: this requires `canUpdateOwnMetadata` permission encoded in the token.
* The change does not take immediate effect.
* If successful, a `ParticipantEvent.ParticipantNameChanged` event will be emitted on the local participant.
* Note: this requires `canUpdateOwnMetadata` permission.
* @param metadata
*/
setName(name: string): void {
this.name = name;
this.engine.client.sendUpdateLocalMetadata(this.metadata ?? '', name);
}

Expand Down
Loading