You are here

protected function FacebookFetcher::getApiEndpointUrl in Media entity facebook 8.2

Same name and namespace in other branches
  1. 8 src/FacebookFetcher.php \Drupal\media_entity_facebook\FacebookFetcher::getApiEndpointUrl()
  2. 3.x src/FacebookFetcher.php \Drupal\media_entity_facebook\FacebookFetcher::getApiEndpointUrl()

Return the appropriate Facebook oEmbed API endpoint for the content URL.

Parameters

string $content_url: The content URL contains the URL to the resource.

Return value

string The oEmbed endpoint URL.

1 call to FacebookFetcher::getApiEndpointUrl()
FacebookFetcher::getOembedData in src/FacebookFetcher.php
Fetch and return response from Facebook's oEmbed API endpoint.

File

src/FacebookFetcher.php, line 115

Class

FacebookFetcher
Class FacebookFetcher.

Namespace

Drupal\media_entity_facebook

Code

protected function getApiEndpointUrl($content_url) {
  if (preg_match('/\\/videos\\//', $content_url) || preg_match('/\\/video.php\\//', $content_url)) {
    return 'https://www.facebook.com/plugins/video/oembed.json/';
  }
  else {
    return 'https://www.facebook.com/plugins/post/oembed.json/';
  }
}