phuochau / react-native-thumbnail

Get thumbnail from local media. Currently, it only supports for video.
MIT License
135 stars 104 forks source link

Implement timestamp option for ios #21

Open n1ru4l opened 6 years ago

n1ru4l commented 6 years ago

Implements #18

Code sample:

import RNThumbnail from 'react-native-thumbnail';
const timestampInSeconds = 3
RNThumbnail.get(filepath, { timestamp: timestampInSeconds }).then((result) => {
  console.log(result.path); // thumbnail path
})
phuochau commented 5 years ago

@n1ru4l I think the code example is wrong? The timestamp should be an option of get function

n1ru4l commented 5 years ago

@phuochau I updated the example, however the code is fully functional

watadarkstar commented 5 years ago

@n1ru4l What would happen if that frame / timestamp doesn't exist?

n1ru4l commented 5 years ago

@watadarkstar You will receive the last frame if the timestamp exceeds the maximum duration of the video.

@phuochau Is there anything further you need to be added before merging this?

Offtopic:

@phuochau Have you considered moving this repository over to react-native-community or adding additional maintainers? This could improve the quality and development of this library significantly.