MioVisman / FluxBB_by_Visman

My modification of FluxBB
GNU General Public License v2.0
78 stars 13 forks source link

Use oembed #25

Closed romulasry closed 1 year ago

romulasry commented 1 year ago

https://oembed.com/

MioVisman commented 1 year ago

Media.js uses oembed for vimeo, soundcloud, hearthis.at. I tried to use oembed for coub, facebook, twitter, but met with a CORS ban.

romulasry commented 1 year ago

As of Oct 24 2020, Facebook and Instagram require you to create a live facebook app with an oEmbed product enabled to embed posts. App ID App Secret

MioVisman commented 1 year ago

Even if this is done for facebook, the request from javascript will still not be executed, since the browser does not receive the necessary headers from the site in the response and CORS restrictions come into effect.

But fb works without oembed: fb

Provided that uBlock Origin and the browser's built-in protection against user tracking is turned off.

romulasry commented 1 year ago

I guess you would have to do it via php:

7.3. Libraries

PHP: php-oembed (http://code.google.com/p/php-oembed/)
PHP: Services_oEmbed (http://pear.php.net/package/Services_oEmbed)
PHP: Essence (https://github.com/felixgirault/essence)
PHP: Embera (https://github.com/mpratt/Embera)

See: https://oembed.com/ ?

MioVisman commented 1 year ago

In my build, javascript is responsible for displaying media content https://github.com/MioVisman/FluxBB_by_Visman/blob/master/js/media.min.js I won't move media content processing to parser.php.

romulasry commented 1 year ago

There is also this in javascript: https://www.npmjs.com/package/@extractus/oembed-extractor

MioVisman commented 1 year ago

As far as I understand, the author uses a script on his server as a proxy to bypass CORS policy restrictions in the browser.

What kind of media services do you want to get oembed for? Maybe the script can be made without oembed, or these services give the necessary headers for oembed to work from under javascript.

romulasry commented 1 year ago

That is okay, you can close this. Thanks.