Closed romulasry closed 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.
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
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:
Provided that uBlock Origin and the browser's built-in protection against user tracking is turned off.
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/ ?
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.
There is also this in javascript: https://www.npmjs.com/package/@extractus/oembed-extractor
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.
That is okay, you can close this. Thanks.
https://oembed.com/