Open ricardopacheco opened 7 years ago
sounds reasonable, we could fallback to use the content-type from the http request maybe?
Yea, ruby-oembed gem has an implementation in that sense that you said.
https://github.com/ruby-oembed/ruby-oembed/blob/master/lib/oembed/response.rb#L29
The question is to have the URL type in to_json and boolean methods to check for themselves, type @object.video?
@object.image?
This will help, for example, render specific views for each case.
@gottfrois You could put another hash with the request information?
Like this:
{
request: {
content-type: ...,
...
},
object: {
url: '...',
title: '...',
}
}
This alternative hash could be returned by user option for example: generate (url, http_headers: true)
Is it possible to have a method that returns the content type of the page? In oembed there is a key that returns this.
Example
{ title: 'example', type: 'video', url: ... }