Using embedded assets plugin to display youtube or vimeo embed urls on a template I'm trying to use the "Embedded Assets" Craft plug-in to embed Youtube and Vimeo videos in a matrix field, but I can't figure it out. I've read through the instructions on the Github page but I can't make sense of it.

I have successfully installed the plug-in, and it seems to be "grabbing" the videos correctly since I can see the video in the assets section and the json files are in the folder on my disk.

I put this twig code from the instructions of the plugin provider in my template:

{% for asset in assets %}
    {% set embed = craft.embeddedAssets.fromAsset(asset) %}
    {% if embed %}
        {{ embed.safeHtml|raw }}
    {% endif %}
{% endfor %}


but it breaks my page. 

This is the error message I get, saying the variable "assets" does not exist:

52         &lt;div class="video"&gt;
53                 {% for videoEmbed in videoEmbed %}
54                     {% set embed = craft.embeddedAssets.entry.    (videoEmbed) %}
55                     {% if embed %}
56                     {{ embed.safeHtml|raw }}
57                     {% endif %}
58                 {% endfor %}
59                 {% endif %}
60 
61         &lt;/div&gt;
62 
63             
64         {% endfor %}


I work locally and have dev mode turned on.

I am trying to use the plugin inside a matrix field with "videoEmbed" as block and field handle.

I created an asset source/ folder called "videos".

And I am on the personal licence.
You need to define your assets, if the asset field is named videoEmbed in your matrix matrixFieldHandle you would loop through the matrix and grab the first asset with:

{% for block in entry.matrixFieldHandle %}

  {% set asset = block.videoEmbed.first() %}

  {% set embed = craft.embeddedAssets.fromAsset(asset) %}

  {% if embed %}
    {{ embed.safeHtml|raw }}
  {% endif %}

{% endfor %}


You can find additional information about matrix-fields and templating here: https://craftcms.com/docs/matrix-fields#templating