In one of my
It is not a bad thing to make a service paid. They have added many new features after that. I liked it even more.
However, my client was not earning a significant amount of money from his website. As a
Some days later he asked me to use https://noembed.com in the project as it is a free service.
As I started to look into it. I went to their demo page https://noembed.com/demo. Unfortunately, I found that many of the websites do not work with
However, I just had to add the functionality of dynamically embedding data from basically 3 video websites. They are YouTube, Vimeo, and
The usage is really straight forward.
To embed the
https://noembed.com/embed?url=https://www.youtube.com/watch?v=ee1172yeqyE
This will return a JSON response like –
{ "author_url":"https://www.youtube.com/user/movieclipsTRAILERS", "type":"video", "provider_url":"https://www.youtube.com/", "thumbnail_height":360, "width":480, "provider_name":"YouTube", "url":"https://www.youtube.com/watch?v=ee1172yeqyE", "author_name":"Movieclips Trailers", "title":"Avengers: Endgame Trailer #1 (2019) | Movieclips Trailers", "thumbnail_width":480, "height":270, "thumbnail_url":"https://i.ytimg.com/vi/ee1172yeqyE/hqdefault.jpg", "version":"1.0", "html":"\n<iframe width=\" 480\" height=\"270\" src=\"https://www.youtube.com/embed/ee1172yeqyE?feature=oembed\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"></iframe>\n" }
Notice the ‘
You will have to
url = 'https://www.youtube.com/watch?v=ee1172yeqyE' content = JSON.parse(open("https://noembed.com/embed?url=#{CGI::escape(url)}").read) puts content['html']
You can use
However, you will find many of the sites do not work with noembed. For this reason, before using noembed for your project test thoroghly if the your desired sites work with it or not.
Leave a Reply