Can't load network images in gl-react-expo package.
See original GitHub issuefeature request
Ability to load network images in gl-react-expo package.
The ExponentTextureLoader
only supports loading using a RN module number. It doesn’t support other image sources such as remote or local/cached files using a format similar to { uri: 'https://...' }
or { uri: 'file:///...' }
I’m guessing that you’ve already run into this issue since your cookbook-rn
examples that use network images such as transitions
use static images in the cookbook-expo
version.
Is there a possible workaround for this? I’ve considered creating my own TextureLoader
that loads an ImageSource
. It would be exactly the same as the ExponentTextureLoader
except this line. That logic would change to use Expo.Asset.fromModule(...)
if the ImageSource
is a number (the same as it already does) or construct an Expo.Asset
manually if it is a network image. I would then use TextureLoaders
to remove the ExponentTextureLoader
and add my own. I haven’t tried this yet but if it works and you are okay with this solution, I’ll make a PR for the ExponentTextureLoader
library version
gl-react@3.0.0-alpha.6 gl-react-expo@3.0.0-alpha.6
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
I’ve released a 3.1.0 that supports remote images by downloading them to a local asset. this is a temporary solution as EXGLView implementation will soon provide a nicer way to handle that 😃
Thank you. something new?, I can not load yet uri local value (file://data/data…) from camera. IOS work but not in android. 😦