parent = false; $this->blocks = array( ); } protected function doDisplay(array $context, array $blocks = array()) { // line 2 $context["default"] = $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "config", array()), "media", array()); // line 3 $context["oembed"] = $this->getAttribute(($context["mediaembed"] ?? null), "service", array()); // line 4 echo " "; // line 6 if ( !$this->getAttribute(($context["mediaembed"] ?? null), "success", array())) { // line 7 echo " "; if ($this->getAttribute(($context["default"] ?? null), "responsive", array())) { // line 8 echo " "; $context["class"] = "-responsive mediaembed-msod"; // line 9 echo " "; } else { // line 10 echo " "; $context["class"] = ((" mediaembed-msod\" style=\"max-width: " . $this->getAttribute(($context["default"] ?? null), "width", array())) . "px;"); // line 11 echo " "; } // line 12 echo "

Unable to process oEmbed media:getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "src", array()); echo "\" alt=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "alt", array()); echo "\" title=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "title", array()); echo "\">"; echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "src", array())); echo "

Error:"; // line 16 echo $this->getAttribute(($context["mediaembed"] ?? null), "message", array()); echo "

"; } else { // line 21 echo " "; $context["response"] = $this->getAttribute(($context["oembed"] ?? null), "attributes", array()); // line 22 echo " "; // line 23 echo " "; if (((twig_test_empty($this->getAttribute(($context["response"] ?? null), "width", array())) || !$this->getAttribute(($context["response"] ?? null), "width", array(), "any", true, true)) || ($this->getAttribute(($context["response"] ?? null), "width", array()) == 0))) { // line 24 echo " "; $context["response"] = twig_array_merge(($context["response"] ?? null), array("width" => (($this->getAttribute(($context["default"] ?? null), "width", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["default"] ?? null), "width", array()), 1)) : (1)))); // line 25 echo " "; } // line 26 echo " "; // line 27 if (((twig_test_empty($this->getAttribute(($context["response"] ?? null), "height", array())) || !$this->getAttribute(($context["response"] ?? null), "height", array(), "any", true, true)) || ($this->getAttribute(($context["response"] ?? null), "height", array()) == 0))) { // line 28 echo " "; $context["response"] = twig_array_merge(($context["response"] ?? null), array("height" => (($this->getAttribute(($context["default"] ?? null), "height", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["default"] ?? null), "height", array()), 1)) : (1)))); // line 29 echo " "; } // line 30 echo " "; // line 31 $context["width"] = $this->getAttribute(($context["response"] ?? null), "width", array()); // line 32 echo " "; $context["height"] = $this->getAttribute(($context["response"] ?? null), "height", array()); // line 33 echo " "; $context["ratio"] = (($context["height"] ?? null) / ($context["width"] ?? null)); // line 34 echo " "; // line 36 echo " "; if ($this->getAttribute(($context["default"] ?? null), "adjust", array())) { // line 37 echo " "; // line 38 echo " "; if ((((($context["width"] ?? null) * ($context["ratio"] ?? null)) > $this->getAttribute(($context["default"] ?? null), "height", array())) || ((($context["height"] ?? null) / ($context["ratio"] ?? null)) > $this->getAttribute(($context["default"] ?? null), "width", array())))) { // line 39 echo " "; // line 40 echo " "; $context["width"] = (($this->getAttribute(($context["default"] ?? null), "width", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["default"] ?? null), "width", array()), 1)) : (1)); // line 41 echo " "; $context["height"] = twig_round(($this->getAttribute(($context["default"] ?? null), "width", array()) * ($context["ratio"] ?? null))); // line 42 echo " "; } // line 43 echo " "; } else { // line 44 echo " "; $context["width"] = (($this->getAttribute(($context["default"] ?? null), "width", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["default"] ?? null), "width", array()), 1)) : (1)); // line 45 echo " "; $context["height"] = (($this->getAttribute(($context["default"] ?? null), "height", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute(($context["default"] ?? null), "height", array()), 1)) : (1)); // line 46 echo " "; } // line 47 echo " "; // line 49 echo " "; $context["ratio"] = (($context["height"] ?? null) / ($context["width"] ?? null)); // line 50 echo " "; $context["container_styles"] = (("padding-bottom: " . sprintf("%.2f", (($context["ratio"] ?? null) * 100))) . "%;"); // line 51 echo " "; // line 53 echo " "; if ($this->getAttribute(($context["default"] ?? null), "responsive", array())) { // line 54 echo " "; $context["responsive"] = "-responsive"; // line 55 echo " "; // line 56 $context["width"] = 1920; // line 57 echo " "; $context["height"] = twig_round((($context["width"] ?? null) * ($context["ratio"] ?? null))); // line 58 echo " "; } else { // line 59 echo " "; $context["styles"] = ((((" style=\"max-width: " . ($context["width"] ?? null)) . "px; max-height: ") . ($context["height"] ?? null)) . "px;\""); // line 60 echo " "; } // line 61 echo " "; // line 63 echo " "; if ($this->getAttribute(($context["default"] ?? null), "preview", array())) { // line 64 echo " "; $context["lazyload"] = " lazyload"; // line 65 echo " "; $context["lazyload_script"] = " onclick=\"lazyload(this)\""; // line 66 echo " "; } // line 67 echo "
getAttribute(($context["oembed"] ?? null), "type", array()); echo " mediaembed-"; echo twig_lower_filter($this->env, $this->getAttribute(($context["oembed"] ?? null), "name", array())); echo ($context["lazyload"] ?? null); echo "\""; echo ($context["styles"] ?? null); echo ">
"; // line 71 echo " "; // line 73 echo " "; if (($this->getAttribute(($context["oembed"] ?? null), "type", array()) == "photo")) { // line 74 echo " "; $context["title"] = (((($this->getAttribute($this->getAttribute(($context["oembed"] ?? null), "getOembed", array(), "method"), "provider_name", array()) . ": “") . $this->getAttribute(($context["oembed"] ?? null), "title", array())) . "” by ") . $this->getAttribute(($context["oembed"] ?? null), "author", array())); // line 75 echo " getAttribute(($context["oembed"] ?? null), "author", array(0 => "url"), "method"); echo "\" title=\""; echo ($context["title"] ?? null); echo "\"> getAttribute(($context["oembed"] ?? null), "url", array()); echo "\" alt=\""; echo $this->getAttribute(($context["oembed"] ?? null), "title", array()); echo "\"> "; // line 80 echo " "; } elseif (($this->getAttribute(($context["oembed"] ?? null), "type", array()) == "video")) { // line 81 echo " getAttribute(($context["oembed"] ?? null), "getEmbedCode", array()); echo "\" alt=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "alt", array()); echo "\" title=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "title", array()); echo "\" class=\"mediaembed-media\""; echo ($context["lazyload_script"] ?? null); echo "> "; // line 83 echo " "; // line 90 echo " "; if (($this->getAttribute(($context["default"] ?? null), "preview", array()) && $this->getAttribute(($context["oembed"] ?? null), "thumbnail", array()))) { // line 91 echo " getAttribute(($context["oembed"] ?? null), "thumbnail", array()); echo "\" alt=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "alt", array()); echo "\" title=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "title", array()); echo "\" class=\"mediaembed-thumbnail\" /> "; } else { // line 93 echo " "; // line 94 echo " "; } // line 95 echo " "; // line 97 echo " getAttribute(($context["mediaembed"] ?? null), "uid", array()); echo "\" class=\"mediaembed-input\" /> "; // line 100 echo " "; // line 110 echo " "; } elseif (($this->getAttribute(($context["oembed"] ?? null), "type", array()) == "link")) { // line 111 echo " "; $context["title"] = (((($this->getAttribute($this->getAttribute(($context["oembed"] ?? null), "getOembed", array(), "method"), "provider_name", array()) . ": “") . (($this->getAttribute($this->getAttribute($this->getAttribute(($context["oembed"] ?? null), "mediaembed", array(), "any", false, true), "raw", array(), "any", false, true), "title", array(), "any", true, true)) ? (_twig_default_filter($this->getAttribute($this->getAttribute($this->getAttribute(($context["oembed"] ?? null), "mediaembed", array(), "any", false, true), "raw", array(), "any", false, true), "title", array()), ($context["title"] ?? null))) : (($context["title"] ?? null)))) . "” by ") . $this->getAttribute(($context["oembed"] ?? null), "author", array())); // line 112 echo " getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "src", array()); echo "\" alt=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "alt", array()); echo "\" title=\""; echo ($context["title"] ?? null); echo "\">"; echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "src", array())); echo " "; // line 114 echo " "; } elseif (($this->getAttribute(($context["oembed"] ?? null), "type", array()) == "rich")) { // line 115 echo "
"; echo $this->getAttribute(($context["oembed"] ?? null), "getEmbedCode", array(), "method"); echo "
"; // line 118 echo " "; } else { // line 119 echo " "; // line 120 echo " getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "src", array()); echo "\" alt=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "alt", array()); echo "\" title=\""; echo $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "title", array()); echo "\">"; echo twig_escape_filter($this->env, $this->getAttribute($this->getAttribute(($context["mediaembed"] ?? null), "raw", array()), "src", array())); echo " "; } // line 122 echo "
"; } } public function getTemplateName() { return "partials/mediaembed.html.twig"; } public function isTraitable() { return false; } public function getDebugInfo() { return array ( 350 => 122, 338 => 120, 336 => 119, 333 => 118, 327 => 115, 324 => 114, 313 => 112, 310 => 111, 307 => 110, 301 => 106, 289 => 101, 286 => 100, 280 => 97, 277 => 95, 274 => 94, 272 => 93, 262 => 91, 259 => 90, 247 => 84, 244 => 83, 233 => 81, 230 => 80, 222 => 76, 215 => 75, 212 => 74, 209 => 73, 206 => 71, 202 => 69, 191 => 68, 188 => 67, 185 => 66, 182 => 65, 179 => 64, 176 => 63, 173 => 61, 170 => 60, 167 => 59, 164 => 58, 161 => 57, 159 => 56, 156 => 55, 153 => 54, 150 => 53, 147 => 51, 144 => 50, 141 => 49, 138 => 47, 135 => 46, 132 => 45, 129 => 44, 126 => 43, 123 => 42, 120 => 41, 117 => 40, 115 => 39, 112 => 38, 110 => 37, 107 => 36, 104 => 34, 101 => 33, 98 => 32, 96 => 31, 93 => 30, 90 => 29, 87 => 28, 85 => 27, 82 => 26, 79 => 25, 76 => 24, 73 => 23, 71 => 22, 68 => 21, 61 => 16, 51 => 15, 46 => 13, 43 => 12, 40 => 11, 37 => 10, 34 => 9, 31 => 8, 28 => 7, 26 => 6, 23 => 4, 21 => 3, 19 => 2,); } /** @deprecated since 1.27 (to be removed in 2.0). Use getSourceContext() instead */ public function getSource() { @trigger_error('The '.__METHOD__.' method is deprecated since version 1.27 and will be removed in 2.0. Use getSourceContext() instead.', E_USER_DEPRECATED); return $this->getSourceContext()->getCode(); } public function getSourceContext() { return new Twig_Source("{# Shortcut variables #} {% set default = mediaembed.config.media %} {% set oembed = mediaembed.service %} {# Processing error #} {% if not mediaembed.success %} {% if default.responsive %} {% set class = \"-responsive mediaembed-msod\" %} {% else %} {% set class = \" mediaembed-msod\\\" style=\\\"max-width: \" ~ default.width ~ \"px;\" %} {% endif %}

Unable to process oEmbed media:{{ mediaembed.raw.src|e }}

Error:{{ mediaembed.message }}

{# Setup block #} {% else %} {% set response = oembed.attributes %} {# Normalize response #} {% if (response.width is empty) or not (response.width is defined) or (response.width == 0) %} {% set response = response|merge({'width' : default.width|default(1)}) %} {% endif %} {% if (response.height is empty) or not (response.height is defined) or (response.height == 0) %} {% set response = response|merge({'height' : default.height|default(1)}) %} {% endif %} {% set width = response.width %} {% set height = response.height %} {% set ratio = height / width %} {# Adjust OEmbed media dimensions or restrict them? #} {% if default.adjust %} {# Check if computed height is larger than default setting #} {% if (width * ratio) > default.height or (height / ratio) > default.width %} {# Rescale width and height #} {% set width = default.width|default(1) %} {% set height = (default.width * ratio)|round %} {% endif %} {% else %} {% set width = default.width|default(1) %} {% set height = default.height|default(1) %} {% endif %} {# Recompute aspect ratio #} {% set ratio = height / width %} {% set container_styles = \"padding-bottom: \" ~ \"%.2f\"|format(ratio * 100) ~ \"%;\" %} {# Embed responsive OEmbed media #} {% if default.responsive %} {% set responsive = \"-responsive\" %} {% set width = 1920 %} {% set height = (width * ratio)|round %} {% else %} {% set styles = \" style=\\\"max-width: \" ~ width ~ \"px; max-height: \" ~ height ~ \"px;\\\"\" %} {% endif %} {# Setup lazy loading media for those with preview enabled #} {% if default.preview %} {% set lazyload = \" lazyload\" %} {% set lazyload_script = \" onclick=\\\"lazyload(this)\\\"\" %} {% endif %}
{# Embed content according to media type #} {# -- Photo -- #} {% if oembed.type == \"photo\" %} {% set title = oembed.getOembed().provider_name ~ ': “' ~ oembed.title ~ '” by ' ~ oembed.author %} \"{{ {# -- Video -- #} {% elseif oembed.type == \"video\" %} {# JavaScript lazy-loading #} {# Show Thumbnail #} {% if default.preview and oembed.thumbnail %} \"{{ {% else %} {# Show placeholder #} {% endif %} {# Toggle for loading iframe content #} {# Implement JavaScript-less lazyload technique #} {# -- Link -- #} {% elseif oembed.type == \"link\" %} {% set title = oembed.getOembed().provider_name ~ ': “' ~ oembed.mediaembed.raw.title|default(title) ~ '” by ' ~ oembed.author %} {{ mediaembed.raw.src|e }} {# -- Rich media -- #} {% elseif oembed.type == \"rich\" %}
{{ oembed.getEmbedCode() }}
{# -- Nothing from above -- #} {% else %} {# Show at least a link for the user #} {{ mediaembed.raw.src|e }} {% endif %}
{% endif %} ", "partials/mediaembed.html.twig", "/home/kevin/Sites/static-ethica.net/user/plugins/mediaembed/templates/partials/mediaembed.html.twig"); } }