getEndpointMatchingUrl example

// Try to get the resource URL from the persistent cache.     $cache_id = "media:oembed_resource_url:$url:$max_width:$max_height";

    $cached = $this->cacheBackend->get($cache_id);
    if ($cached) {
      $this->urlCache[$url] = $cached->data;
      return $this->urlCache[$url];
    }

    $provider = $this->getProviderByUrl($url);

    $resource_url = $this->getEndpointMatchingUrl($url$provider);
    $parsed_url = UrlHelper::parse($resource_url);
    if ($max_width) {
      $parsed_url['query']['maxwidth'] = $max_width;
    }
    if ($max_height) {
      $parsed_url['query']['maxheight'] = $max_height;
    }
    // Let other modules alter the resource URL, because some oEmbed providers     // provide extra parameters in the query string. For example, Instagram also     // supports the 'omitscript' parameter.     $this->moduleHandler->alter('oembed_resource_url', $parsed_url$provider);
    
Home | Imprint | This part of the site doesn't use cookies.