'I have programmed a camera to record video. And, in order to "capture" the data output for the video to have sound, I use the following code to set the audio.
AVAudioSession.sharedInstance().requestRecordPermission { (granted: Bool) -> Void in
            if granted {
                let audioCaptureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeAudio)
                do {
                    let audioInput = try AVCaptureDeviceInput(device: audioCaptureDevice)
                    self.session?.addInput(audioInput)
                } catch {
                }
            }
        }
The problem is that I would like to play music via a bluetooth speaker at the same time that the video is recording. I have discovered that the above code causes music to only play from the device's speakers and not from a connected Bluetooth device.
I have reviewed a lot of stack overflow posts on this topic, however I have yet to find a satisfactory solution to my problem. How can I record video using the device's camera and mic while allowing to play music from a connected bluetooth speaker using Swift 2 programming?