ldn0x7dc / react-native-media-kit

Video(and audio) component for react-native apps, supporting both iOS and Android. A unified and elegant player controller is provided by default. The API is similar with HTML video.
200 stars 70 forks source link

Video thumbnail image #4

Closed vandervidi closed 8 years ago

vandervidi commented 8 years ago

Hi, Is there a way to generate a thumbnail image and present it until the user presses play?

ldn0x7dc commented 8 years ago

@vandervidi Not for now, but this feature should be of high priority in next releases. But, if preload is 'none', then no loading should be happening before user presses play. So I prefer using poster prop (not implemented for now), like the html video, which is more flexible in which frame to display.

ldn0x7dc commented 8 years ago

@vandervidi The latest release now supports poster.

vandervidi commented 8 years ago

@ldn0x7dc Great. Is it possible to set a frame from the video to be a poster?

ldn0x7dc commented 8 years ago

@vandervidi It is indeed possible. Both MPMoviePlayerController(iOS) and MediaMetadataRetriever(android) provide interface for retrieving frames. But to display the frame, I have to write native code because the retrieved frame is in native format(say, a Bitmap on android) and could NOT be used by the JS Image component. And for best practice, the frame data should use a cache to avoid reloading(better integrate with existing cache the JS components are using). That means a lot of work. So I'm not planning to do it in a short time.