Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Fix endpoint local tracks overriding
Browse files Browse the repository at this point in the history
  • Loading branch information
incubo4u committed Jan 18, 2024
1 parent 4826110 commit 9e18569
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ios/MembraneWebRTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class MembraneWebRTC: MembraneRTCDelegate {
private func addTrackToLocalEndpoint(_ track: LocalVideoTrack, _ metadata: Metadata) throws {
try ensureEndpoints()
if let localEndpointId = localEndpointId {
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.videoTracks = [track.trackId(): track]
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.videoTracks[track.trackId()] = track
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracksMetadata[track.trackId()] =
metadata
emitEndpoints()
Expand Down Expand Up @@ -337,7 +337,7 @@ class MembraneWebRTC: MembraneRTCDelegate {
private func addTrackToLocalEndpoint(_ track: LocalAudioTrack, _ metadata: Metadata) throws {
try ensureEndpoints()
if let localEndpointId = localEndpointId {
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.audioTracks = [track.trackId(): track]
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.audioTracks[track.trackId()] = track
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracksMetadata[track.trackId()] =
metadata
emitEndpoints()
Expand Down
4 changes: 2 additions & 2 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ export function useEndpoints<

/**
* sets track encoding that server should send to the client library.
* The encoding will be sent whenever it is available. If choosen encoding is
* temporarily unavailable, some other encoding will be sent until choosen encoding
* The encoding will be sent whenever it is available. If chooses encoding is
* temporarily unavailable, some other encoding will be sent until choose encoding
* becomes active again.
*
* @param trackId id of a track which encoding you want to select
Expand Down

0 comments on commit 9e18569

Please sign in to comment.