December 2018 update:
I don't have an up-to-date Flarum install at the moment so if you're having issues with this extensions, try fof/formatting instead. Both extensions use the same underlying code.
To install: (run in the Flarum directory)
composer require s9e/flarum-ext-mediaembed:*
There are two ways to embed content: either by posting the URL as-is, or by using a
Here's the list of supported sites, depending on which version of s9e\TextFormatter is bundled in Flarum.