Giter Club home page Giter Club logo

Comments (9)

gre avatar gre commented on July 26, 2024

can you precise what happens? Does it crash / does it renders black?

from react-native-view-shot.

neegqi avatar neegqi commented on July 26, 2024

not crash, called Promise catch and return error "Failed to capture view snapshot"

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

I'll try to improve the error message because it's probably breaking internally in the Android side (it's Android, right?)

from react-native-view-shot.

neegqi avatar neegqi commented on July 26, 2024

no it`s on ios real device,using react native video module to play hls Stream,

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

Ok. I'll give a try! it might be that the drawViewHierarchyInRect function returns FALSE and I'll need to see what's the way to fix it / get a better error message.

from react-native-view-shot.

neegqi avatar neegqi commented on July 26, 2024

thanks

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

I think the error needs to be more clear or it should just renders something black (not this weird error).
but note that it's likely snapshotting a video won't work (maybe we'll have good surprise, but not sure!). see actually TheWidlarzGroup/react-native-video#95

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

I'm afraid currently answer is you can't.
even thought it seems to work on Simulator, the renderInContext does not work for Video, it renders black (if ignoring the returned value of drawViewHierarchyInRect – I don't want to ignore it and prefer the call to be a failure promise so you can deal with it and not end up with a black image)

– at least it's not possible with the video from react-native-video, therefore, it will be up to this library to provide you a way to get a snapshot from a video. and it's possible to do, but it needs lower level API calls ( http://stackoverflow.com/questions/8291727/ios-extracting-video-frames-as-images )

from react-native-view-shot.

gre avatar gre commented on July 26, 2024

we could find a generic solution that react-native-view-shot would use, like react-native-video could expose some sort of generic method we would duck-call. but i'll leave that to the following issue: TheWidlarzGroup/react-native-video#95

from react-native-view-shot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.