Repeating group with type of file

Good morning to all guys. I was trying to create a gallery of files for each user. Now I have created a repeating group that takes the files the user has selected. My problem is when the user inserts different types of files (specifically photos or videos).
This is what I created :

.
Basically with an html div I insert the video that the user has uploaded and this has worked, the video is actually visible on the page. The problem is that I also inserted another element inside the cell, the one to show the images. This way if the user uploads a video, then the html div is used, otherwise the image element is used. My problem is that when a user tries to upload an image, the element is also loaded into the html video which obviously does not show anything because it is not a video format. So how can I tell him if the user has uploaded a video (for example through the extension), show me the html div, while if he uploaded an image show me only the image and not the video container?
This is the orrible result when user upload an image

This topic was automatically closed after 70 days. New replies are no longer allowed.