As of October 24, 2020, Facebook changed their oembed API and video embeds (and probably other FB embeds) have broken. See this announcement on Facebook.

Comments

Rob_Feature created an issue. See original summary.

Rob_Feature’s picture

Hope this helps someone....basically the new API requires adding an appid and app secret into the request for the oembed data. This isn't a final solution, but it works as a quick fix. In your oembed.module file, find the oembed_get_data() function and add some code to tack on these parameters for facebook_video or facebook_post requests (it stores the appid and secret as variables in the database)...it'll end up looking something like this:

function oembed_get_data($url, $parameters = array()) {
  $matches = array();
  $parameters = array_filter($parameters);
  
  // Remote oEmbed endpoint request.
  if ($plugin = oembed_get_provider($url, $matches)) {

   //custom addition to handle FB API change:
   // https://developers.facebook.com/docs/plugins/oembed
   if($plugin['name'] == 'default:facebook_video' OR $plugin['name'] == 'default:facebook_post'){
     $appId = variable_get('fb_appid', 'YOUR_APP_ID');
     $appSecret = variable_get('fb_sec', 'YOUR_APP_SECRET');
     $parameters['access_token'] = $appId . '|' . $appSecret;
   }
    return oembed_oembed_fetch($plugin, $url, $matches, $parameters);
  }
  return FALSE;
}

You also need to change your endpoints for facebook video/posts (at /admin/config/media/oembed/provider) to:

Ideally, we'd add a couple form fields in the UI (just for the facebook-related providers) to gather this facebook data, then save them as a variable....

dries arnolds’s picture

This is also true for Instagram.

jshimota01’s picture

This has become a nightmare - users are running 'revert site' and 'switchold' to move back to the old interface which is interacting and causing breaks - either you get 1/2 your users one way, or 1/2 the other. the desire to have this feature is quickly loosing the battle with the maintenence. And add now Parler... sigh.

Rob_Feature’s picture

Our Facebook embeds are totally dead now (even after the updates above that were previously working). Now the Facebook Oembed API needs to be approved, but we can't seem to figure out how to get approval based on our use with this module.

Anyone else?

Rob_Feature’s picture

Just an update: Got oembed approved by Facebook (going thru the Facebook App approval process) and it now is up and running again. So this new code works correctly as of today.

astonvictor’s picture

Status: Active » Closed (outdated)

D7 reached its EOL back in January 2025, and there is no active release for D7 for this module anymore.
Development or support is not planned for D7. All D7-related issues are marked as outdated in a bunch.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.