viromedia / viro

ViroReact: AR and VR using React Native
MIT License
2.31k stars 483 forks source link

ViroVideo is crashing if Wrapped in "ViroFlexView" #604

Open krishanjangir opened 5 years ago

krishanjangir commented 5 years ago

If "ViroVideo" is Wrappedup in "ViroNode" it's working but if the "ViroVideo" is wrapped up in "ViroFlexView" application is crashing -

"react": "16.8.3",
"react-native": "0.59.3",
"react-viro": "2.14.0"

Below Code is working

<ViroNode position={[x, y, z]} width={wdt} height={hgt}>
     <ViroVideo  height={videoHeight} width={videoWdith} paused={false} loop={true} 
     source={{uri:'https://firebasestorage.googleapis.com/v0/b/odoori- 
          de298.appspot.com/o/Videos%2F2_1556398090985.mp4? 
            alt=media&token=ccfce9f7-89e9-4f55-8d82-97750452ee6a'}}>
 </ViroVideo>
</ViroNode>

Below is crashing

 <ViroFlexView position={[x, y, z]} width={wdt} height={hgt}>
     <ViroVideo  height={videoHeight} width={videoWdith} paused={false} loop={true} 
     source={{uri:'https://firebasestorage.googleapis.com/v0/b/odoori- 
          de298.appspot.com/o/Videos%2F2_1556398090985.mp4? 
            alt=media&token=ccfce9f7-89e9-4f55-8d82-97750452ee6a'}}>
 </ViroVideo>
</ViroFlexView>
krishanjangir commented 5 years ago

@VikAdvani

Could you please check above issue ?

existenzial commented 5 years ago

You have <ViroVideo width={videoWdith} ... /> vs. <ViroVideo width={videoWidth} ... />. Might be a typo issue? I wonder if the reference error is failing silently causing the app to crash.

divyangbargali commented 2 years ago

my app is also crashing code is below-:

import React, { useState } from 'react'; import { StyleSheet } from 'react-native'; import { ViroARScene, ViroText, ViroConstants, ViroARSceneNavigator, ViroNode, ViroSphere, Viro3DObject, ViroAmbientLight, ViroScene, ViroImage, ViroFlexView, Viro360Image, Viro360Video, ViroAnimatedImage, ViroAnimations, ViroBox, ViroARImageMarker, ViroARPlane, ViroARPlaneSelector, ViroButton, ViroCamera, ViroDirectionalLight, ViroVideo } from '@viro-community/react-viro';

const InititalScene = () => {

return (

<ViroARScene >

  <ViroFlexView
    backgroundColor="#fff"
    width={0.5}
    height={0.2}
    opacity={1}
  >
    <ViroVideo
      source={require('./m.mp4')}
      loop={true}
      position={[0, 0, -5]}
    />
  </ViroFlexView>
</ViroARScene>

); }

export default () => { return ( <ViroARSceneNavigator initialScene={{ scene: InititalScene }} style={{ flex: 1 }} /> ); };

var styles = StyleSheet.create({

});