@@ -126,6 +126,7 @@ extension ConferenceViewController: AntMediaClientDelegate
126
126
}
127
127
128
128
public func dataReceivedFromDataChannel( streamId: String , data: Data , binary: Bool ) {
129
+
129
130
130
131
}
131
132
@@ -252,6 +253,30 @@ extension ConferenceViewController: AntMediaClientDelegate
252
253
if eventType == EVENT_TYPE_TRACK_LIST_UPDATED {
253
254
conferenceClient? . getBroadcastObject ( forStreamId: streamId)
254
255
}
256
+ else if ( eventType == EVENT_TYPE_VIDEO_TRACK_ASSIGNMENT_LIST) {
257
+
258
+ if let unwrappedPayload = payload ? [ " payload " ] as? [ [ String : Any ] ] {
259
+
260
+ //let array = unwrappedPayload as? [[String: Any]]
261
+ for (item) in unwrappedPayload
262
+ {
263
+ if let trackId = item [ " trackId " ] as? String ,
264
+ let videoLabel = item [ " videoLabel " ] as? String
265
+ {
266
+
267
+ print ( " videoLabel: \( videoLabel) plays the trackId: \( trackId) " )
268
+ //On the server side, we create WebRTC tracks with ARDAMSv{VIDEO_LABEL}
269
+ //It's useful in limiting/dynamic allocation of the streams and tracks in a conference call
270
+ //If you want to make sure, which webrtc track is playing which real streamId,
271
+ //you can learn from here
272
+
273
+ //i.e. you receive ARDAMSvvideoTrack0 in trackAdded method above, then you'll receive this event
274
+ //and it will tell you videoTrack0 is playing the specific streamId.
275
+ //If ARDAMSvvideoTrack0 starts to play another trackId, then you'll receive this event again.
276
+ }
277
+ }
278
+ }
279
+ }
255
280
}
256
281
}
257
282
0 commit comments