Open
Description
I am creating a Fragment in an app which displays this Fullscreen video view. The fragment has a button to open a device directory. Right after selecting a video file I'm creating a file from it in onActivityResult. But when I assign this File to fullscreen-video-view (inside onActivityResult) the app crashes after selecting a video
`override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if(requestCode == 55 && resultCode == Activity.RESULT_OK){
val myinputstream = requireContext().contentResolver.openInputStream(data?.data!!)
myVideoFile = File.createTempFile("vid", "vid")
myinputstream.use { input ->
myVideoFile.outputStream().use { output ->
input!!.copyTo(output)
}
}
fullscreenVideoView.videoFile(myVideoFile) // myVideoFile is declared as **lateinit var myVideoFile: File**
}
}`
How to solve this issue? Where should I use fullscreenVideoView.videoFile(myVideoFile)
after selecting a file... Thank you for help!
Metadata
Metadata
Assignees
Labels
No labels