Hi folks,
I’m struggling to make video embeds responsive within an HTML element. I have set my app up such that users can grab the embed code provided by YouTube or Vimeo and enter it on a form. I am then trying to call on that code using an HTML element as follows to display the video to other users:
My problem is that YouTube gives dimensions in its embed code, so that is breaking the responsiveness. I search the forum here, and the closest I got to a fix was this post, which led me here. This explains the code I’ve added in my screenshot above. Although it worked the very first time I checked it, it has failed every time since (not sure why, as I didn’t change anything!).
Does anyone know a solution to this? Thanks in advance!