clickrain / videolink

Video Link is a Field Type add-on for ExpressionEngine that enables easy and user-friendly embedding of user-defined YouTube and Vimeo videos.
MIT License
15 stars 6 forks source link

[object Object] error on thumbnail #16

Closed petenice closed 9 years ago

petenice commented 9 years ago

{my_field_name:thumbnail} returning [object Object] error

bryanburgers commented 9 years ago

@petenice Thanks for reporting this issue. Would you mind answering a few questions so I can get to the bottom of this?

petenice commented 9 years ago

Sorry about the delay. Answers follow:

  1. VideoLink 1.5.0
  2. Trying to embed YouTube video
  3. Browsering with Chrome 43
  4. I believe it returned "[object Object]"
  5. Error occured when creating a new entry

Thank you for your excellent work and helpful contribution! It's a great tool.

peteheaney commented 9 years ago

I was going to create a new issue, but I think this is probably the same thing....

The JSON feed returned by the YouTube API has changed. You need to update videolink.js. Change line 34 from:

'thumbnail': data.items[0].snippet.thumbnails.maxres

to:

'thumbnail': data.items[0].snippet.thumbnails.high.url

bryanburgers commented 9 years ago

@peteheaney Thanks for finding that! Would you be willing to submit a pull request?

bryanburgers commented 9 years ago

@petenice I believe this is fixed because of Pull Request #18. I've merged that into master. Can you give that a try to see if it fixes your problem before I cut a release?

petenice commented 9 years ago

Success! Thank you both!