- Issue created by @dan612
- 🇮🇳India rajeshreeputra Pune
Try using
getAsset($asset_id)
method.$asset_data = \Drupal::service('acquia_dam.client.factory')->getSiteClient()->getAsset($asset_id); if ($asset_data) { $asset_url = $asset_data['embeds']['original']; }
- 🇮🇳India rajeshreeputra Pune
You can also try
/** @var \Drupal\acquia_dam\Plugin\media\Source\Asset $source */ $source = $media->getSource(); $embed_codes = $source->getMetadata($media, 'embeds'); $url = $embed_codes['original']['url'];
- 🇺🇸United States dan612 Portland, Maine
Thank you! these are working for me. Much more streamlined 😁.
Would it be worth adding these to the README in a ## DEVELOPER USAGE section?