MrBartusek / gif-picker-react

Tenor GIF Picker component for React ⚛️
http://dokurno.dev/gif-picker-react/
MIT License
38 stars 12 forks source link

Expose other media types like MP4 #39

Open matthewlewandowski93 opened 3 weeks ago

matthewlewandowski93 commented 3 weeks ago

The Tenor API returns other media types besides GIF. It would be great if the TenorImage object returned a media object with all of the potential types, instead of picking out the gif and returning it.

const preview = img['media_formats']['tinygif'];
const gif = img['media_formats']['gif'];

const media = img['media_formats'];

For reference: https://developers.google.com/tenor/guides/response-objects-and-errors#content-formats

My application uses a lot of gifs on one page, and it's significantly more performant to use MP4s when they are available. It also loads a lot faster.

matthewlewandowski93 commented 3 weeks ago

Looks like this request is related: https://github.com/MrBartusek/gif-picker-react/issues/38

I've just realized that you are including the gif and tiny gif in the parameters. It would be amazing if these were configurable. You could specify which files you want in the media object.