Skip to content

Getting blank screen when reopens the camera in some Iphones #43

@ctlincfaisal

Description

@ctlincfaisal

Camera got open fine at the first time, Then when i leave the page and comes back, I see blank screen.
Some suggestions says to shutdown the camera when goes back and then when you come back to camera page it will reinitialised itself. But the deepARRef1 does not contain shutdown function to call.
Here is the code i am using

import React, { useEffect, useRef } from 'react';
import { TouchableOpacity } from 'react-native';
import { View } from 'react-native';
import { Text } from 'react-native';
import DeepARView from 'react-native-deepar';

const DeepARWrapper = (props) => {
const deepARRef1 = useRef(null);

return (
<View style={{ flex: 1 }}>
<TouchableOpacity
style={{
position: 'absolute',
top: 70,
left: 20,
zIndex: 33333,
flexDirection: 'row',
justifyContent: 'center',
alignItems: 'center'
}}
onPress={()=>{
deepARRef1.current.shutdown(); // tried to call here

        props.navigation.goBack();
      }}>
        <Text style={{ color: 'red', marginLeft: 5 }}>Go Back</Text>
      </TouchableOpacity>
      <DeepARView 
        ref={deepARRef1}
        apiKey="-" 
        style={{flex: 1}} 
        onInitialized={() => {
          // deepARRef1.current.resume();
          console.log('==================initialized now==================');
        }}
        onShutdownFinished={() => {
          
          console.log('================== onShutdownFinished now ==================');
        }}
      />
</View>

);
};

export default DeepARWrapper;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions