Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option handleGLSurfaceViewOnAndroid doesn't work for captureRef #541

Open
caiotoledo-lunasystems opened this issue Sep 4, 2024 · 0 comments

Comments

@caiotoledo-lunasystems
Copy link

bug report

The property handleGLSurfaceViewOnAndroid in CaptureOptions doesn't work for the captureRef method.

Version & Platform

npm ls react-native react-native-view-shot #
[email protected] /home/caio-toledo/LunaSystems/projects/luna-oculus
├─┬ @aws-amplify/[email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @react-native-async-storage/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-community/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-community/[email protected]
│ └── [email protected] deduped
├─┬ @react-native-community/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ ├─┬ @react-navigation/[email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ └── [email protected] deduped
├─┬ @react-navigation/[email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ @react-native-picker/[email protected]
│ │ └── [email protected] deduped
│ └─┬ [email protected]
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ ├─┬ @aws-amplify/[email protected]
│   │ │ └─┬ @aws-amplify/[email protected]
│   │ │   └─┬ [email protected]
│   │ │     └── [email protected] deduped
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ @aws-amplify/[email protected]
│   │     └─┬ [email protected]
│   │       └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ [email protected]
│   │   └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   ├─┬ @aws-amplify/[email protected]
│   │ └─┬ @aws-amplify/[email protected]
│   │   └─┬ [email protected]
│   │     └── [email protected] deduped
│   └─┬ @aws-amplify/[email protected]
│     └─┬ @aws-amplify/[email protected]
│       └─┬ [email protected]
│         └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] deduped
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └── [email protected] deduped
└─┬ [email protected]
  └─┬ @react-native/[email protected]
    └── [email protected] deduped

Platform: Android?

Expected behavior

I have the following view:

<View ref={viewRef} style={styles.container}>
  <GstPlayer
    style = {styles.videoPlayer}
    uri = {uri}
    ref = {gstPlayerRef}
    onStateChanged={onStateChanged}
  />
</View>

const styles = StyleSheet.create({
  container: {flex: 1, justifyContent: 'center', alignItems: 'center'},
  videoPlayer: {flex: 1, width: '100%', height: '100%'}
})

In case I try to capture the viewRef using:

    captureRef(viewRef, {
      format: "jpg",
      quality: 1,
      handleGLSurfaceViewOnAndroid: true
    }).then(
      (uri) => {
        console.log("Image saved to", uri)
      },
      (error) => {
        console.error("Oops, snapshot failed", error)
      }
    );

I always get the error.

But in case I use the captureScreen method with the same parameters it works fine.

Actual behavior

Both captureRef and captureScreen should have the same behaviour.

Steps to reproduce the behavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant