embedding youtube videos over https

This commit is contained in:
arlogn 2014-01-25 23:26:53 +01:00
parent e1e69882ad
commit 1563d088bc
4 changed files with 9 additions and 7 deletions

View file

@ -15,6 +15,8 @@ oembed_provider_list = [
OEmbed::Providers::Flickr
]
OEmbed::Providers::Youtube.endpoint += "?scheme=https"
oembed_providers = YAML.load_file(Rails.root.join("config", "oembed_providers.yml"))
oembed_providers.each do |provider_name, provider|

View file

@ -41,7 +41,7 @@ Given /^I have several oEmbed data in cache$/ do
"thumbnail_width" => 480,
},
"link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json",
"oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
"oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_video" => {
@ -86,7 +86,7 @@ Given /^I have several oEmbed data in cache$/ do
"thumbnail_width" => 480,
},
"link_url" => "http://yourichtube.com/watch?v=M3r2XDceM6A&format=json",
"oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
"oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_rich" => {

View file

@ -79,7 +79,7 @@ describe StreamsController do
stub_request(
:get,
"http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A"
"http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://www.youtube.com/watch?v=UYrkQL1bX4A"
).with(
:headers => {'Accept'=>'*/*'}
).to_return(

View file

@ -29,7 +29,7 @@ describe OEmbedHelper do
"type" => "video",
"width" => 425,
"height" => 344,
'trusted_endpoint_url' => ::OEmbed::Providers::Youtube.endpoint,
"trusted_endpoint_url" => ::OEmbed::Providers::Youtube.endpoint,
"title" => "Amazing Nintendo Facts",
"html" => "<object width=\"425\" height=\"344\">
<param name=\"movie\" value=\"http://www.youtube.com/v/M3r2XDceM6A&fs=1\"></param>
@ -41,7 +41,7 @@ describe OEmbedHelper do
</object>",
},
"link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json",
"oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
"oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_video" => {
@ -69,7 +69,7 @@ describe OEmbedHelper do
"type" => "rich",
"width" => 425,
"height" => 344,
'trusted_endpoint_url' => ::OEmbed::Providers::Youtube.endpoint,
"trusted_endpoint_url" => ::OEmbed::Providers::Youtube.endpoint,
"title" => "Amazing Nintendo Facts",
"html" => "<object width=\"425\" height=\"344\">
<param name=\"movie\" value=\"http://www.youtube.com/v/M3r2XDceM6A&fs=1\"></param>
@ -81,7 +81,7 @@ describe OEmbedHelper do
</object>",
},
"link_url" => "http://youtube.com/watch?v=M3r2XDceM6A&format=json",
"oembed_get_request" => "http://www.youtube.com/oembed?format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
"oembed_get_request" => "http://www.youtube.com/oembed?scheme=https&format=json&frame=1&iframe=1&maxheight=420&maxwidth=420&url=http://youtube.com/watch?v=M3r2XDceM6A",
},
"unsecure_rich" => {