Closed danleecreates closed 5 years ago
Looks like the plugin is trying to load a URL that doesn't exist. Move {% set videoEmbed = craft.videoEmbedder.getEmbedUrl(videoUrl) %}
and {% set providerName = craft.videoEmbedder.getProviderName(videoUrl) %}
inside the conditional like so:
{# Video Block #}
{% set videoUrl = block.video %}
{% if videoUrl | length %}
{% set videoEmbed = craft.videoEmbedder.getEmbedUrl(videoUrl) %}
{% set providerName = craft.videoEmbedder.getProviderName(videoUrl) %}
<div class="{{ padding }} {{ fontsize }}">
<div class="{{ margin }}">
{% if providerName == 'YouTube' %}
<div class="aspect-ratio aspect-ratio--16x9">
<iframe class="aspect-ratio--object" src="{{ videoEmbed }}" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
{% endif %}
{% if providerName == 'Vimeo' %}
<div class="aspect-ratio aspect-ratio--16x9">
<iframe class="aspect-ratio--object" src="{{ videoEmbed }}" frameborder="0" webkitallowfullscreen mozallowfullscreen allowfullscreen></iframe>
</div>
{% endif %}
</div>
</div>
{% endif %}
Let me know if that works for you. If not, I'll try and look into it more
Yes that seems to be working for me now!
I currently get the following error when a field for the URL is empty:
_Embed\Exceptions\InvalidUrlException