Skip to content

A platform for community discussion. Free, open, simple.

FIX: Explicitly set `allowfullscreen` on Wistia Oneboxes (#15828)

jbrw4ef56b0ca4d9
diff --git a/lib/onebox/engine/wistia_onebox.rb b/lib/onebox/engine/wistia_onebox.rb
index 4abb2ff7fc4..0c4744d417f 100644
--- a/lib/onebox/engine/wistia_onebox.rb
+++ b/lib/onebox/engine/wistia_onebox.rb
@@ -11,7 +11,25 @@ module Onebox
always_https
def to_html
- get_oembed.html
+ oembed = get_oembed
+ extracted_url = oembed.html.match(/iframe\ src\=\"(.*?)\"/)
+
+ if extracted_url
+ iframe_src = extracted_url[1]
+
+ <<-HTML
+ <iframe
+ src="#{iframe_src}"
+ width="#{oembed.width}"
+ height="#{oembed.height}"
+ title="#{oembed.title}"
+ frameborder="0"
+ allowfullscreen
+ ></iframe>
+ HTML
+ else
+ oembed.html
+ end
end
def placeholder_html