lucasbento / react-native-thumbnail-video

Easily show thumbnails for videos on react-native.
MIT License
106 stars 36 forks source link

Support Vimeo #3

Open johncblandii opened 7 years ago

johncblandii commented 7 years ago

If I get time, I'll help in this area. Don't wait on me if anyone else has the time, though. ;)

I could use this so hopefully I can find time soon.

lucasbento commented 7 years ago

Thank you for the issue, @johncblandii.

This would be an awesome addition, I don't have time available right now but I would love to review a PR.

retyui commented 5 years ago

To get vimeo video thumbnail image:

# https://vimeo.com/api/v2/video/<VIMEO_ID>.json
curl https://vimeo.com/api/v2/video/259730902.json

reseponse:

[
  {
    id: 259730902,
    title: 'Freedom ballet   AM:PM',
    description:
      'Created by Konstantin Gordienko<br />\r\nCamera Yevgeniy Sakhno<br />\r\nEdit Konstantin Gordienko<br />\r\nPost Maxim Rozumnyi<br />\r\nColor Olga Domashenko<br />\r\nGaffer Denis Shevchenko<br />\r\nStyle Tanya Gordienko',
    url: 'https://vimeo.com/259730902',
    upload_date: '2018-03-12 14:13:51',
    thumbnail_small: 'https://i.vimeocdn.com/video/688268528_100x75.jpg',
    thumbnail_medium: 'https://i.vimeocdn.com/video/688268528_200x150.jpg',
    thumbnail_large: 'https://i.vimeocdn.com/video/688268528_640.jpg',
    user_id: 81647174,
    user_name: 'G production',
    user_url: 'https://vimeo.com/user81647174',
    user_portrait_small: 'https://i.vimeocdn.com/portrait/28407890_30x30.jpg',
    user_portrait_medium: 'https://i.vimeocdn.com/portrait/28407890_75x75.jpg',
    user_portrait_large:
      'https://i.vimeocdn.com/portrait/28407890_100x100.jpg',
    user_portrait_huge: 'https://i.vimeocdn.com/portrait/28407890_300x300.jpg',
    stats_number_of_likes: 2731,
    stats_number_of_plays: 184660,
    stats_number_of_comments: 68,
    duration: 1143,
    width: 1920,
    height: 1080,
    tags: 'dance, contemporary, art, twin peaks, freedom ballet, ballet',
    embed_privacy: 'anywhere',
  },
];

We need some HOC to help extract this information withVimeoInfoExtractor()(Thumbnail)