mardi 15 décembre 2015

No embeddable content at a youtube link

I'm currently using oEmbed in my rails app.

When a Youtube link gets removed by its owner it breaks the oEmbed, which in turn breaks the index page. Showing the following error:

No embeddable content at...

Is there a way to make oEmbed only embed functional links? or that it shows on the index page but shows the link as inactive/not functional?

My index.html.haml:

@videos.each do |video|
  - @youtube = OEmbed::Providers::Youtube.get(video.link)
  .video
    .video_image
      = link_to (image_tag @youtube.thumbnail_url.html_safe), video
    .video_content
      .title
        %h2= link_to truncate(@youtube.title.html_safe, :length => 40), video

Aucun commentaire:

Enregistrer un commentaire