Transformer Kt
object TransformerKt
A Kotlin coroutine wrapper around Media3's Transformer API.
Use the extension functions on a Transformer instance:
suspend fun transform(context: Context, input: Uri, output: File) {
val transformer = Transformer.Builder(context).build()
val result = transformer.start(input, output) { progress ->
// Update UI with progress
}
// Handle the result
}
Content copied to clipboard
Or as a Flow:
suspend fun transform(context: Context, input: Uri, output: File) {
val transformer = Transformer.Builder(context).build()
transformer.start(input, output).collect (status) {
// Handle the result
}
}
Content copied to clipboard
Properties
Link copied to clipboard
Link copied to clipboard
A TransformationRequest that transforms the video to H264 and audio to AAC.
Link copied to clipboard
A TransformationRequest that transforms the video to H264.
Link copied to clipboard
A TransformationRequest that uses the default values.
Functions
Link copied to clipboard
Build a Transformer instance.