diff --git a/android/src/main/java/com/opentokreactnative/OTScreenCapturer.java b/android/src/main/java/com/opentokreactnative/OTScreenCapturer.java index cb4a1144..9994390c 100644 --- a/android/src/main/java/com/opentokreactnative/OTScreenCapturer.java +++ b/android/src/main/java/com/opentokreactnative/OTScreenCapturer.java @@ -74,16 +74,19 @@ public void init() { @Override public int startCapture() { - capturing = true; - - mHandler.postDelayed(newFrame, 1000 / fps); + if(!capturing){ + capturing = true; + mHandler.postDelayed(newFrame, 1000 / fps); + } return 0; } @Override public int stopCapture() { - capturing = false; - mHandler.removeCallbacks(newFrame); + if(capturing){ + capturing = false; + mHandler.removeCallbacks(newFrame); + } return 0; }