HBiSoft / HBRecorder

Lightweight screen recording Android library
MIT License
423 stars 141 forks source link

How can I get the path for recorded file? #105

Closed mishu311289 closed 2 years ago

mishu311289 commented 2 years ago

I tried but I'm only getting content uri which is not getting converted to a valid file path. Getting file not found exception while trying to compress the video file. Any help will be much appreciated.

HBiSoft commented 2 years ago

hbrecorder.getFilePath() will only return the file path if it was set using hbrecorder.setOutputPath(String). This library doesn't convert Uri's to File paths, it returns the file path that was set, if it was set. You can have a look at the demo application:

https://github.com/HBiSoft/HBRecorder/blob/d8efaae89566ca221827a255106589737cfca36b/app/src/main/java/com/hbisoft/hbrecorderexample/MainActivity.java#L606-L631

mishu311289 commented 2 years ago

yeah I got that but my requirement is to compress the recorded file once recording is complete so I need to get information about where did the recorded file saved. When I'm trying to convert the output uri (which I'm setting via setOutputUri) to file path it's resulting in file not found exception so I just want to ask how can I get the information on path where the recorded file was saved so that I can pick the file and compress it.