I have an entry with one asset field and i need to determine if the 'kind' of asset is either 'json' file or 'video' file. Basically I swap my HTML based on the return 'kind'.
Any help is greatly appreciated. Craft CMS beginner.
{% set videoEntries = craft.entries({ section: 'mediaRoomVideos' }).find %}
{% if videoEntries is not empty %}
{% for entry in videoEntries %}
{% set asset = entry.mediaVideo.first() %}
{% if asset %}
{% set json = asset.kind('json') %}
{% if json %}
Do Embedded Video
{% else %}
<video width="320" height="240" controls>
<source src="{{ entry.mediaVideo.first.getUrl() }}">
</video>
{% endif %}
{% endif %}
{% endfor %}
{% endif %}