Theme video-embed-iframe.html.twig by content type I am using Drupal 8 and trying to theme video-embed-iframe.html.twig by content type. with the current naming suggestions this is not possible. 

I am using Media with video embed field containing in a field called video

This is what I did so far. in the fields template named above in the templates folder of my theme

{% if logged_in %}
 &lt;iframe{{ attributes }}{% if url is not empty %} src="{{ url }}{% if     
 query is not empty %}?{{ query | url_encode }}{% endif %}"{% endif
 %}&gt;&lt;/iframe&gt;
{% else %}

 &lt;div id="promotion"&gt;
 &lt;div id="promotion-image"&gt;
   &lt;div id ="promotion-bg"&gt;
 &lt;div id ="promotion-text"&gt;
 &lt;H1&gt;Eine brilliante Überschrift&lt;/H1&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;span id="promotion-attribution"&gt;
 &lt;a href="http://somesite.com"&gt;Credit author of the background image&lt;/a&gt;&lt;/span&gt;
&lt;/div&gt;
{% endif %}


I have no clue how to access the field by content type to separate the code deepening if you have a content type eg page and article
Any Ideas?

Is there a way to populate a global var like logged in containing the mashine name of the content type without needing a custom module. I other words is there a way to populate a var like 

contenttype=anycotenttypehere in the mytheme.theme file by writing a function? to be able to display the video depending on with contetnt type has been used and if the user is logged in or not
That's not easily possible, not directly.

By default a media entity is going to be render cached on its own, that means the same media could be used in two different nodes with a different type and as long as they use the same view mode, it is only going to be built once. While you can get the current node easily on the detail page in preprocess and you could vary the rendered media by path, that will possibly result in a lot of variations and won't really work on views and other pages that display teasers of many nodes.

The easist way to achieve something like this would be to define two different view modes, use one from one node type and the second from the other.