 
         self.recordingURL = recordingURL
 
-        try super.init(sessionPreset: sessionPreset)
+        try super.init(sessionPreset: sessionPreset, position: position)
 
         try addOutput(videoDataOutput, toCaptureSession: captureSession)
         try addOutput(audioDataOutput, toCaptureSession: captureSession)
 
-        guard let unwrappedVideoConnection = videoDataOutput.connectionWithMediaType(AVMediaTypeVideo) else {
-            throw MedusaError.CaptureDeviceError
-        }
-
-        guard let unwrappedAudioConnection = audioDataOutput.connectionWithMediaType(AVMediaTypeAudio) else {
-            throw MedusaError.AudioDeviceError
-        }
-
-        videoConnection = unwrappedVideoConnection
-        audioConnection = unwrappedAudioConnection
+        (videoConnection, audioConnection) = try fetchConnections(fromVideoDataOutput: videoDataOutput, andAudioDataOutput: audioDataOutput)
 
         let videoDataOutputQueue = dispatch_queue_create("top.limon.capturesession.videodata", DISPATCH_QUEUE_SERIAL)
         let audioDataOutputQueue = dispatch_queue_create("top.limon.capturesession.audiodata", DISPATCH_QUEUE_SERIAL)


        synchronized(self) {
            guard recordingStatus == .StoppingRecording else { return }
            // No state transition, we are still in the process of stopping.
            // We will be stopped once we save to the assets library.
        }

        synchronized(self) {

        outputAudioFormatDescription = nil
        outputVideoFormatDescription = nil

        (videoConnection, audioConnection) = try fetchConnections(fromVideoDataOutput: videoDataOutput, andAudioDataOutput: audioDataOutput)
    }
}


// MARK: AssetWriterCoordinatorDelegate

