 
 	/** New track as been added. */
 	func peerConnection(_ peerConnection: RTCPeerConnection, didAdd rtpReceiver: RTCRtpReceiver, streams:[RTCMediaStream]) {
-		
+
 		NSLog("PluginRTCPeerConnection | onaddtrack")
-		
+
 		// TODO why streams.count is 0 and should it trigger addtrack
 		// TODO why NSLog streamId cause crash need weak ?
 		let streamId : String = streams.count > 0 ? streams[0].streamId : "";
-		
+
 		let track = PluginMediaStreamTrack(
 		   rtcMediaStreamTrack: rtpReceiver.track!,
 		   streamId: streamId
 		)
-	   
+
 		self.eventListener([
 		   "type": "addtrack",
 		   "track": track.getJSON()

			])
		}
	}
 
	/** New ice candidate has been found. */
	func peerConnection(_ peerConnection: RTCPeerConnection, didGenerate candidate: RTCIceCandidate) {
		NSLog("PluginRTCPeerConnection | onicecandidate [sdpMid:%@, sdpMLineIndex:%@, candidate:%@]",

			"stream": pluginMediaStream.getJSON()
		])
	}

	/** Called when a remote peer closes a stream. */
	func peerConnection(_ peerConnection: RTCPeerConnection, didRemove stream: RTCMediaStream) {
		NSLog("PluginRTCPeerConnection | onremovestream")

		let pluginMediaStream = pluginMediaStreams[stream.streamId];

		// Let the plugin remove it from its dictionary.
		self.eventListenerForRemoveStream(pluginMediaStream!.id)

		self.eventListener([
			"type": "removestream",
			"streamId": pluginMediaStream!.id
		])
	}

	/** Called when the SignalingState changed. */

	// TODO: remove on M75
	// This was already fixed in M-75, but note that "Issue 740501: RTCPeerConnection.onnegotiationneeded can sometimes fire multiple times in a row" was a prerequisite of Perfect Negotiation as well.
	// https://stackoverflow.com/questions/48963787/failed-to-set-local-answer-sdp-called-in-wrong-state-kstable
	// https://bugs.chromium.org/p/chromium/issues/detail?id=740501
	// https://bugs.chromium.org/p/chromium/issues/detail?id=980872
	var isNegotiating = false;

	func peerConnection(_ peerConnection: RTCPeerConnection, didChange stateChanged: RTCSignalingState) {
		let state_str = PluginRTCTypes.signalingStates[stateChanged.rawValue] as String?

		NSLog("PluginRTCPeerConnection | onsignalingstatechange [signalingState:%@]", String(describing: state_str))

		isNegotiating = (state_str != "stable")

		self.eventListener([
			"type": "signalingstatechange",
			"signalingState": state_str!
