Skip to content

Commit

Permalink
Fix issue HBiSoft#24
Browse files Browse the repository at this point in the history
  • Loading branch information
HBiSoft committed Aug 13, 2020
1 parent 0debe54 commit 43b8eda
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@
*
* 1. Implement HBRecorderListener by calling implements HBRecorderListener
* After this you have to implement the methods by pressing (Alt + Enter)
* This will create a method called HBRecorderOnComplete()
* This method will be called once the recording is done.
*
* 2. Declare HBRecorder
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public class HBRecorder implements MyListener {
private int videoBitrate = 40000000;
private String outputFormat = "DEFAULT";
private int orientation;
boolean wasOnErrorCalled = false;

@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
public HBRecorder(Context context, HBRecorderListener listener) {
Expand Down Expand Up @@ -277,6 +278,7 @@ protected void onReceiveResult(int resultCode, Bundle resultData) {
if (!mWasUriSet) {
observer.stopWatching();
}
wasOnErrorCalled = true;
hbRecorderListener.HBRecorderOnError(100, errorListener);
try {
Intent mservice = new Intent(context, ScreenRecordService.class);
Expand All @@ -287,7 +289,10 @@ protected void onReceiveResult(int resultCode, Bundle resultData) {

}else if (onComplete != null){
//OnComplete for when Uri was passed
hbRecorderListener.HBRecorderOnComplete();
if (mWasUriSet && !wasOnErrorCalled) {
hbRecorderListener.HBRecorderOnComplete();
}
wasOnErrorCalled = false;
}else if (onStart != null){
hbRecorderListener.HBRecorderOnStart();
}
Expand Down

0 comments on commit 43b8eda

Please sign in to comment.