ruby-oembed / ruby-oembed

oEmbed for Ruby

Home Page:http://oembed.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parse youtube URLs with time index

jhass opened this issue · comments

Seems to be working for me? Tested in irb with version 0.14.1 just now.

require 'json'
require 'oembed'

embed = OEmbed::Providers::Youtube.get('https://www.youtube.com/watch?v=mtdQ5roMuEA#t=32s')

embed.html
#=> "<iframe width=\"459\" height=\"344\" src=\"https://www.youtube.com/embed/mtdQ5roMuEA?start=32&feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen></iframe>"

Note the ?start=32 in the src URL.

Ah, I didn't retest this in quite a while, maybe they fixed the endpoint since :)