How to create caption for embeds other than images?

There seems to be some solutions for creating captions for images in Adding caption to images

However, is it possible to create captions for an embedded video or audio? What about external embeds like Youtube and Twitter?

Thanks for the help!