Works great!
Is it possible to embed this into an update of the theme?
I am not working with a child theme so I had to paste this into the functions file of the generatepress theme, which will be overridden by an update.
Or is there another way to add functions to the theme?
Anything that modifies your content should be done via a plugin or custom snippet. Otherwise your content will lost formatting if you ever decide to switch themes, which is no fun.
The other theme obviously had something like this added to their code which isn’t transferable and that’s not good, because when you switch themes and function is lost.
If you tested with a twenty series themes from WordPress, the videos shouldn’t be responsive either.