FIX: Vimeo private video oneboxes were broken (#14510)

This commit is contained in:
Arpit Jalan 2021-10-05 15:46:58 +05:30 committed by GitHub
parent 71cf05fbc6
commit fbe9cd49b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -18,12 +18,8 @@ module Onebox
end
def to_html
video_id = oembed_data[:video_id]
if video_id.nil?
# for private videos
video_id = uri.path[/\/(\d+)/, 1]
end
video_src = "https://player.vimeo.com/video/#{video_id}"
video_src = Nokogiri::HTML5::fragment(oembed_data[:html]).at_css('iframe')&.[]("src")
video_src = "https://player.vimeo.com/video/#{oembed_data[:video_id]}" if video_src.blank?
video_src = video_src.gsub('autoplay=1', '').chomp("?")
<<-HTML