             }
             
             self.videoConfig = videoConfig
+
+            // get cameraParams from the JS params
+            self.camera = config.objectForKey("camera") as? String
             
             // add local video view
             if self.videoConfig!.local != nil {
                 if self.localVideoTrack == nil {
-                    self.initLocalVideoTrack()
+                    if(self.camera == "Front" || self.camera == "Back") {
+                        self.initLocalVideoTrack(self.camera!)
+                    }else {
+                        self.initLocalVideoTrack()
+                    }
                 }
                 
                 if self.videoConfig!.local == nil {

    var videoSource: RTCVideoSource?
    var localVideoView: RTCEAGLVideoView?
    var remoteVideoViews: [VideoTrackViewPair]!

    var localVideoTrack: RTCVideoTrack?
    var localAudioTrack: RTCAudioTrack?

            .videoTrackWithID("ARDAMSv0", source: self.videoSource)
    }
    
    func initLocalVideoTrack(camera: String) {
        NSLog("PhoneRTC: initLocalVideoTrack(camera: String) invoked")
        var cameraID: String?
        for captureDevice in AVCaptureDevice.devicesWithMediaType(AVMediaTypeVideo) {
            // TODO: Make this camera option configurable
            if captureDevice.position == AVCaptureDevicePosition.Front {
                if camera == "Front"{
                    cameraID = captureDevice.localizedName
                }
            }
            if captureDevice.position == AVCaptureDevicePosition.Back {
                if camera == "Back"{
                    cameraID = captureDevice.localizedName
                }
            }
        }
        
        self.videoCapturer = RTCVideoCapturer(deviceName: cameraID)
        self.videoSource = self.peerConnectionFactory.videoSourceWithCapturer(
            self.videoCapturer,
            constraints: RTCMediaConstraints()
        )
        
        self.localVideoTrack = self.peerConnectionFactory
            .videoTrackWithID("ARDAMSv0", source: self.videoSource)
    }
    
    func addRemoteVideoTrack(videoTrack: RTCVideoTrack) {
        if self.videoConfig == nil {
            return
