- Issue created by @nicxvan
- πΊπΈUnited States Chris Burge
Their oEmbed implementation works:
https://oembed.libsyn.com/?url=https://oembed.libsyn.com/embed?item_id=26035914
{ "version": 1, "type": "rich", "provider_name": "Libsyn", "provider_url": "https://www.libsyn.com", "height": 90, "width": 600, "title": "Talking Drupal #388 - Valhalla Content Hub", "description": "Today we are talking about Valhalla Content Hub with Shane Thomas. For show notes visit: www.talkingDrupal.com/388 Topics Joining Netlify Changes at Gatsby What is a content hub How does that differ from a content repo What is Valhalla How does it work Data stitching with GraphQL Can you massage / normalize data Benefits Privacy Production examples How is it structured Do you have to use Gatsby Integrations with Drupal Timing Cost How to sign up Resources Valhalla Guests Shane Thomas - www.codekarate.com/ @smthomas3 Hosts Nic Laflin - www.nLighteneddevelopment.com @nicxvan John Picozzi - www.epam.com @johnpicozzi Jacob Rockowitz - www.jrockowitz.com @jrockowitz MOTW Correspondent Martin Anderson-Clutz - @mandclu Entity Share You configure one site to be the Server that provides the entities, and content types or bundles will be available, and in which languages. ", "author_name": "Talking Drupal", "author_url": "http://www.talkingdrupal.com", "html": "<iframe title=\"Libsyn Player\" style=\"border: none\" src=\"//html5-player.libsyn.com/embed/episode/id/26035914/height/90/theme/custom/thumbnail/yes/direction/forward/render-playlist/no/custom-color/88AA3C/\" height=\"90\" width=\"600\" scrolling=\"no\" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe>", "thumbnail_url": "https://assets.libsyn.com/secure/item/26035914" }
What is the 'Provider name' for your custom provider? Based on the response from the provider, it'll need to be 'Libsyn' (case sensitive). See #3298738: Document that provider_name should match the one return by the oEmbed endpoint β for details.
- πΊπΈUnited States nicxvan
Thank you for replying! I missed your response.
Using the json response you showed me I attached a screenshot of my config and unfortunately it's still not working, I'm not sure what I am missing.
I am using this url in the url field of the media entity: https://oembed.libsyn.com/embed?item_id=26035914
I get the following error: The provided URL does not represent a valid oEmbed resource.
- πΊπΈUnited States Chris Burge
See
\Drupal\media\OEmbed\ResourceFetcher::createResource()
:protected function createResource(array $data, $url) { $data += [ 'title' => NULL, 'author_name' => NULL, 'author_url' => NULL, 'provider_name' => NULL, 'cache_age' => NULL, 'thumbnail_url' => NULL, 'thumbnail_width' => NULL, 'thumbnail_height' => NULL, 'width' => NULL, 'height' => NULL, 'url' => NULL, 'html' => NULL, 'version' => NULL, ]; if ($data['version'] !== '1.0') { // <--- HERE throw new ResourceException("Resource version must be '1.0'", $url, $data); }
Version must be "1.0".
Now take a look at the response from the provider:
{ "version": 1, <---- HERE "type": "rich", "provider_name": "Libsyn", "provider_url": "https://www.libsyn.com", "height": 90, "width": 600,
Version is "1", not "1.0".
Now, take a look at https://oembed.com/ at "2.3.4. Response parameters"
Responses can specify a resource type, such as photo or video. Each type has specific parameters associated with it. The following response parameters are valid for all response types:
type (required)
The resource type. Valid values, along with value-specific parameters, are described below.
version (required)
The oEmbed version number. This must be 1.0.Conclusion: The provider's response is invalid.
- Status changed to Closed: works as designed
over 1 year ago 4:32am 27 April 2023 - πΊπΈUnited States Chris Burge
You could write a pretty simple custom module to change the version from "1" to "1.0".
my_module.service.yml:
services: media.oembed.resource_fetcher: class: Drupal\my_module\OEmbed\ResourceFetcher arguments: ['@http_client', '@media.oembed.provider_repository', '@cache.default']
my_module/src/OEmbed/ResourceFetcher.php:
namespace Drupal\my_module\OEmbed; use Drupal\media\OEmbed\ResourceFetcher as CoreResourceFetcher; /** * Fetches and caches oEmbed resources. */ class ResourceFetcher extends CoreResourceFetcher { /** * {@inheritdoc} */ protected function createResource(array $data, $url) { if ($data'provider_name' == 'Libsyn') { $data['version'] = '1.0'; } return parent::createResource($data, $url) } }