the media extractor works perfectly for many other versions. But when doing on android 26 it throws
java.io.IOException: Failed to instantiate extractor.
This is how it is being set. The videoFileDescriptor is perfectly valid.
The error is in the last line .setDataSource
and in apis 26.
private fun getVideoData(videoFileDescriptor: ParcelFileDescriptor?): Pair<MediaExtractor?, MediaFormat?> {
val videoExtractor = MediaExtractor()
videoExtractor.setDataSource(videoFileDescriptor.fileDescriptor)