From 55af71c646befa496c6a43f42d0f03e4208b0c14 Mon Sep 17 00:00:00 2001 From: Mattia Iavarone Date: Fri, 4 Aug 2017 22:20:29 +0200 Subject: [PATCH] setLocation support for videos --- .../src/main/api16/com/flurgle/camerakit/Camera1.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java index 37835133..5e909e7b 100644 --- a/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java +++ b/camerakit/src/main/api16/com/flurgle/camerakit/Camera1.java @@ -242,6 +242,10 @@ class Camera1 extends CameraImpl { params.setGpsLongitude(mLongitude); params.setGpsTimestamp(System.currentTimeMillis()); params.setGpsProcessingMethod("Unknown"); + + if (mIsCapturingVideo && mMediaRecorder != null) { + mMediaRecorder.setLocation((float) mLatitude, (float) mLongitude); + } } return true; } @@ -585,7 +589,10 @@ class Camera1 extends CameraImpl { mMediaRecorder.setCamera(mCamera); mMediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA); - mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.DEFAULT); + mMediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER); + if (mLatitude != 0 && mLongitude != 0) { + mMediaRecorder.setLocation((float) mLatitude, (float) mLongitude); + } mMediaRecorder.setProfile(getCamcorderProfile(mVideoQuality)); mMediaRecorder.setOutputFile(mVideoFile.getAbsolutePath());