     /// Property to change camera device between front and back.
     public var cameraDevice = CameraDevice.Back {
         didSet {
-            _updateCameraDevice(cameraDevice)
+            if cameraDevice != oldValue {
+                _updateCameraDevice(cameraDevice)
+            }
         }
     }
 

    }

    /// Property to change camera output quality.
    public var cameraOutputQuality: CameraOutputQuality {
        get {
            return _cameraOutputQuality
        }
        set(newCameraOutputQuality) {
            if newCameraOutputQuality != _cameraOutputQuality {
                _cameraOutputQuality = newCameraOutputQuality
                _updateCameraQualityMode(newCameraOutputQuality)
            }
        }
    }

    private var cameraIsObservingDeviceOrientation = false

    private var _cameraOutputMode = CameraOutputMode.StillImage

    private var tempFilePath: NSURL = {
        let tempPath = NSURL(fileURLWithPath: NSTemporaryDirectory()).URLByAppendingPathComponent("tempMovie").URLByAppendingPathExtension("mp4").absoluteString
