From bdfefe782c16b2eeae68919021486c35eac8896a Mon Sep 17 00:00:00 2001 From: Stephen Tomlinson Date: Tue, 25 Jun 2013 12:11:23 +0100 Subject: [PATCH] Support for embedding videos via HTTPS --- TextformatterVideoEmbed.module | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/TextformatterVideoEmbed.module b/TextformatterVideoEmbed.module index 3081810..e6e4ec4 100644 --- a/TextformatterVideoEmbed.module +++ b/TextformatterVideoEmbed.module @@ -128,8 +128,9 @@ class TextformatterVideoEmbed extends Textformatter implements ConfigurableModul foreach($matches[0] as $key => $line) { + $protocol = $this->config->https ? "https" : "http"; $oembedURL = - "http://www.youtube.com/oembed?url=" . urlencode($matches[1][$key]) . + "$protocol://www.youtube.com/oembed?url=" . urlencode($matches[1][$key]) . "&format=json&maxwidth={$this->maxWidth}&maxheight={$this->maxHeight}"; $videoID = $matches[2][$key]; @@ -161,8 +162,9 @@ class TextformatterVideoEmbed extends Textformatter implements ConfigurableModul foreach($matches[0] as $key => $line) { + $protocol = $this->config->https ? "https" : "http"; $oembedURL = - "http://vimeo.com/api/oembed.json?url=" . urlencode($matches[1][$key]) . + "$protocol://vimeo.com/api/oembed.json?url=" . urlencode($matches[1][$key]) . "&maxwidth={$this->maxWidth}&maxheight={$this->maxHeight}"; $videoID = $matches[2][$key];