Skip to content

Commit

Permalink
chore: some more extras
Browse files Browse the repository at this point in the history
  • Loading branch information
santhoshvai committed Oct 20, 2023
1 parent b6c32dc commit aa6ace4
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import android.content.pm.PackageManager
import android.os.Build
import android.os.Process
import android.util.Rational
import androidx.annotation.RequiresApi
import com.facebook.react.bridge.ReactApplicationContext
import com.facebook.react.bridge.ReactContextBaseJavaModule
import com.facebook.react.bridge.ReactMethod
Expand Down Expand Up @@ -45,6 +46,7 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) : Reac
fun removeListeners(count: Int) {
}

@RequiresApi(Build.VERSION_CODES.O)
@ReactMethod
fun enterPipMode(width: Int, height: Int) {
if (hasPermission()) {
Expand All @@ -57,6 +59,11 @@ class StreamVideoReactNativeModule(reactContext: ReactApplicationContext) : Reac
}
}

override fun onCatalystInstanceDestroy() {
StreamVideoReactNative.pipListeners.clear()
super.onCatalystInstanceDestroy()
}

@ReactMethod
fun canAutoEnterPipMode(value: Boolean) {
StreamVideoReactNative.canAutoEnterPictureInPictureMode = value
Expand Down

0 comments on commit aa6ace4

Please sign in to comment.