Skip to content

Enable/Disable track from Receiver/Sender is broken in case of use with Janus Videoroom #734

@RSATom

Description

@RSATom
  • I have used Google with the error message or bug in association with the library and Cordova words to make sure the issue I'm reporting is only related to iOSRTC.
  • I have provided steps to reproduce (e.g. using sample app code https://github.com/cordova-rtc/cordova-plugin-iosrtc-sample or updated extra/renderer-and-libwebrtc-tests.js file).
  • I have provided versions of third party library name, ios, Xcode and plugin version and adapter.js version if used.

Versions affected

  • Cordova version (e.g 7.1.0): 11.0.0
  • Cordova iOS version (e.g 5.1.0): 6.2.0
  • Plugin version (e.g 6.0.12): master
  • iOS version (e.g 10.2): 15.2.1
  • Xcode version (e.g 11.1 - 11A1027): 13.2.1 (13C100)
  • WebRTC-adapter version (e.g. 7.4.0): 7.4.0
  • WebRTC Framework version (e.g. JSSip 3.1.2): Janus v0.11.6

Description

If try disable tracks gotten from receivers list on official Janus Videoroom demo I get following error in XCode debug console:

HelloVideoroom[383:7666] iosrtcPlugin#MediaStreamTrack_setEnabled() | ERROR: pluginMediaStreamTrack with id=janusa0 does not exist

Steps to reproduce

feeds.forEach(remoteFeed => {
        if(remoteFeed) {
                let peerConnection = remoteFeed.webrtcStuff.pc;
                if (peerConnection) {
                        const receivers = peerConnection.getReceivers();
                        receivers.forEach((receiver) => {
                                receiver.track.enabled = false;
                        })
                }
        }
})

Expected results

Track should be switched to disabled state

Actual results

Above error message

Investigation results

The problem is here:

self.id = rtcMediaStreamTrack.trackId + "_" + UUID().uuidString;

and here:
return self.rtcPeerConnection.transceivers.map({ (transceiver: RTCRtpTransceiver) -> NSDictionary in

i.e. on one side iosrtc alters track id to make it unique, but on other side iosrtc returns tracks from transeivers as is without replace original track id to internal iosrtc's track id.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions