 
 		// Create a RTCPeerConnectionFactory.
 		self.initPeerConnectionFactory();
-			
+
 		// Create a PluginGetUserMedia instance.
 		self.pluginGetUserMedia = PluginGetUserMedia(
 			rtcPeerConnectionFactory: rtcPeerConnectionFactory

			self.emit(command.callbackId, result: CDVPluginResult(status: CDVCommandStatus_OK))
		}
	}
	
	@objc(selectAudioOutputEarpiece:) func selectAudioOutputEarpiece(_ command: CDVInvokedUrlCommand) {
		NSLog("iosrtcPlugin#selectAudioOutputEarpiece()")


			pluginRTCPeerConnection?.removeStream(pluginMediaStream!)
		}
	}

	@objc(RTCPeerConnection_addTrack:) func RTCPeerConnection_addTrack(_ command: CDVInvokedUrlCommand) {

		let pcId = command.argument(at: 0) as! Int
		let trackId = command.argument(at: 1) as! String
		var streamIds : [String] = [];
		let pluginRTCPeerConnection = self.pluginRTCPeerConnections[pcId]
		let pluginMediaStreamTrack = self.pluginMediaStreamTracks[trackId]

		if pluginRTCPeerConnection == nil {
			NSLog("iosrtcPlugin#RTCPeerConnection_addTrack() | ERROR: pluginRTCPeerConnection with pcId=%@ does not exist", String(pcId))
			return;
		}

		if command.argument(at: 2) != nil {
			let id = command.argument(at: 2) as! String
			let pluginMediaStream = self.pluginMediaStreams[id]

			if pluginMediaStream == nil {
				NSLog("iosrtcPlugin#RTCPeerConnection_addTrack() | ERROR: pluginMediaStream with id=%@ does not exist", String(id))
				return;
			}

			let streamId = pluginMediaStream!.rtcMediaStream.streamId;
			streamIds.append(streamId)
			self.saveMediaStream(pluginMediaStream!)
		}

		if pluginMediaStreamTrack == nil {
			NSLog("iosrtcPlugin#RTCPeerConnection_addTrack() | ERROR: pluginMediaStreamTrack with id=\(trackId) does not exist")
			return;
		}

		self.queue.async { [weak pluginRTCPeerConnection, weak pluginMediaStreamTrack] in
			if pluginRTCPeerConnection?.addTrack(pluginMediaStreamTrack!, streamIds) == true {
				self.saveMediaStreamTrack(pluginMediaStreamTrack!)
			}
		}
	}

	@objc(RTCPeerConnection_removeTrack:) func RTCPeerConnection_removeTrack(_ command: CDVInvokedUrlCommand) {
		let pcId = command.argument(at: 0) as! Int
		let trackId = command.argument(at: 1) as! String
