feat: Add width
and height
to VideoFile
output (#2281)
* feat: Add `width` and `height` to `VideoFile` output * Format
This commit is contained in:
@@ -25,6 +25,8 @@ suspend fun CameraView.startRecording(options: RecordVideoOptions, onRecordCallb
|
||||
val map = Arguments.createMap()
|
||||
map.putString("path", video.path)
|
||||
map.putDouble("duration", video.durationMs.toDouble() / 1000.0)
|
||||
map.putInt("width", video.size.width)
|
||||
map.putInt("height", video.size.height)
|
||||
onRecordCallback(map, null)
|
||||
}
|
||||
val onError = { error: RecorderError ->
|
||||
|
@@ -32,7 +32,7 @@ class RecordingSession(
|
||||
private const val AUDIO_CHANNELS = 1
|
||||
}
|
||||
|
||||
data class Video(val path: String, val durationMs: Long)
|
||||
data class Video(val path: String, val durationMs: Long, val size: Size)
|
||||
|
||||
private val bitRate = getBitRate()
|
||||
private val recorder: MediaRecorder
|
||||
@@ -106,7 +106,7 @@ class RecordingSession(
|
||||
|
||||
val stopTime = System.currentTimeMillis()
|
||||
val durationMs = stopTime - (startTime ?: stopTime)
|
||||
callback(Video(outputFile.absolutePath, durationMs))
|
||||
callback(Video(outputFile.absolutePath, durationMs, size))
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user