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 [media] BBCode.

https://twitter.com/Flarum/status/637106041876930564
[media]https://www.youtube.com/watch?v=wWarT7rqIYw[/media]

Here's the list of supported sites, depending on which version of s9e\TextFormatter is bundled in Flarum.

    GREAT EXTENSION! Really like it it embeds really well, thank for making this! 🙂

    Thanks!
    Download link is 404 for now though..
    Will wait for it to be up again!

      Hmm.. I didn't see any latest release so cloned it instead.
      When attempting to enable after dropping in extensions/ I get this error:

      2015/08/29 21:07:41 [error] 10335#0: *16093 FastCGI sent in stderr: "PHP message: PHP Notice:  Undefined variable: class in /var/www/flarum/vendor/flarum/core/src/Support/ExtensionManager.php on line 130
      PHP message: PHP Fatal error:  Call to a member function install() on a non-object in /var/www/flarum/vendor/flarum/core/src/Support/ExtensionManager.php on line 58" while reading response header from upstream, client: xxx.xxx.xx.xx server: www.foobar.org, request: "PATCH /api/extensions/s9e-mediaembed HTTP/1.1", upstream: "fastcgi://unix:/var/run/php5-fpm.sock:", host: "www.foobar.org", referrer: "http://www.foobar.org/admin"

        rdn I know, right? 😛 It's not the same code as the XenForo add-on but it's based on the same definitions so the sites are the same.

        erickoh It should be fixed now. I didn't notice the file was in "Draft" mode, only I could download it. 😅

        Kulga Try again with the archive, chances are it'll work better.

          Very nice, just installed it on my test site and it works as intended. Nice to see you support Flarum; been using your XenForo add-on for quite sometime. Keep up the good work!

          honestly, nothing beats this.
          there shall rarely be extension as useful as this one is.

          I'm very thankful @JoshyPHP for making this available for Flarum.
          With that kind of media support Flarum is unstoppable in becoming really best free script out there,
          probably even better than paid stuff.

          Loved your addon on Xenforo, so really nice to see you bring it over here so quickly!

          You're the man.