owt-client-javascript
owt-client-javascript copied to clipboard
Check for the transport id
Subscriptions is a map and not an array, because of that checking on subscription._audioTrackId|_videoTrackId
will actually not work.
For some reason, _audioTrackId and _videoTrackId is actually undefined
. I am not sure if this is a good fix. The issue was caused with this commit: https://github.com/open-webrtc-toolkit/owt-client-javascript/commit/7d316778cea6363abc586ad9b0e4e20fdc9ba5fc
For more information, see discussion in https://github.com/open-webrtc-toolkit/owt-server/issues/1037
Closes #513
Thanks for your PR. Perhaps we need to correctly set _audioTrackId
and _videoTrackId
instead of using transportId
since transportId
is for transport. Multiple publications, subscriptions can share the same the same transport channel. Sometimes, transportId
is the same as stream ID, but it's not guaranteed by design.
Hi, that definitely makes sense. I couldn't find out where the _audioTrackId/_videoTrackId should have been set in the first place.
It could be set after a Subscription
is created. And the initial audio track ID and initial video track ID are mediaOptions.audio.from
and mediaOptions.video.from
in subscribe
method. You may store it in a map and read it when a subscription is created. Track IDs might be updated when user updates its source.