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

Commit

Permalink
Merge branch 'master' into handle-simulcast-setTargetTrackEncoding
Browse files Browse the repository at this point in the history
# Conflicts:
#	ios/MembraneWebRTC.swift
#	src/index.tsx
  • Loading branch information
karkakol committed Jan 22, 2024
2 parents 1aecebc + d5d91d8 commit 4367a34
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
30 changes: 15 additions & 15 deletions ios/MembraneWebRTC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,10 @@ 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]
let trackData = MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()]
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()] =
TrackData(metadata: metadata, simulcastConfig: trackData?.simulcastConfig)
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.videoTracks[track.trackId()] = track
let trackData = MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()]
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()] =
TrackData(metadata: metadata, simulcastConfig: trackData?.simulcastConfig)
emitEndpoints()
}
}
Expand Down Expand Up @@ -338,10 +338,10 @@ 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]
let trackData = MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()]
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()] =
TrackData(metadata: metadata, simulcastConfig: trackData?.simulcastConfig)
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.audioTracks[track.trackId()] = track
let trackData = MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()]
MembraneRoom.sharedInstance.endpoints[localEndpointId]?.tracks[track.trackId()] =
TrackData(metadata: metadata, simulcastConfig: trackData?.simulcastConfig)
emitEndpoints()
}
}
Expand Down Expand Up @@ -499,18 +499,18 @@ class MembraneWebRTC: MembraneRTCDelegate {
"encoding": tracksContexts[trackId]?.encoding?.description as Any,
"encodingReason": tracksContexts[trackId]?.encodingReason?.rawValue as Any,
]

if let simulcast = tracksContexts[trackId]?.simulcastConfig{
let simulcastConfig = [
"enabled": simulcast.enabled,
"activeEncodings": simulcast.activeEncodings.map({ encoding in
encoding.description
})
]

data["simulcastConfig"] = simulcastConfig
}

return data
}

Expand Down Expand Up @@ -568,7 +568,7 @@ class MembraneWebRTC: MembraneRTCDelegate {
let tracksData = MembraneRoom.sharedInstance.endpoints[endpointId]?.tracks[trackId]
MembraneRoom.sharedInstance.endpoints[endpointId]?.tracks[trackId] =
TrackData(metadata: metadata.toMetadata(), simulcastConfig: tracksData?.simulcastConfig)

emitEndpoints()
}

Expand Down Expand Up @@ -922,10 +922,10 @@ class MembraneWebRTC: MembraneRTCDelegate {
globalToLocalTrackId[ctx.trackId] = localTrackId
endpoint.videoTracks[videoTrack.track.trackId] = videoTrack
let trackData = endpoint.tracks[videoTrack.track.trackId]
endpoint.tracks[videoTrack.track.trackId] =

endpoint.tracks[videoTrack.track.trackId] =
TrackData(metadata: ctx.metadata, simulcastConfig: trackData?.simulcastConfig)

if let localTrackId = localTrackId,
tracksContexts[localTrackId] == nil
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@jellyfish-dev/react-native-membrane-webrtc",
"version": "7.1.0",
"version": "7.1.1",
"description": "A React Native client for Membrane WebRTC server.",
"main": "build/index.js",
"types": "build/index.d.ts",
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 chosen encoding is
* temporarily unavailable, some other encoding will be sent until chosen 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 4367a34

Please sign in to comment.