Problem/Motivation

Drupal core ships a media type for local audio (core/recipes/audio_media_type, which this recipe already applies) and one for remote video (core/recipes/remote_video_media_type), but nothing for audio hosted on an external service.

So a site that wants an editor to pick, from one media field, either an uploaded audio file or an episode on SoundCloud, Spotify or Mixcloud has no remote option to offer. The editor has to download the episode and re-upload it, which is wrong for a podcast: the canonical copy lives on the hosting service.

No drupal_cms_* recipe provides one either, so there is nothing to depend on instead.

Core's oEmbed media source has exactly one derivative, oembed:video (see Drupal\media\Plugin\media\Source\OEmbedDeriver), and the list of allowed providers is per media type in source_configuration.providers. So the source plugin is reusable as is, and no new plugin or contrib dependency is needed.

Steps to reproduce

  1. Apply this recipe to a site.
  2. Go to Administration > Structure > Media types.
  3. Audio, Image, Document, Video, SVG image and Remote video are there. There is no media type for remote audio.
  4. Add a media reference field for a podcast episode. There is no bundle to allow that accepts a SoundCloud, Spotify or Mixcloud URL.

Environment: Drupal core ~11.4, Varbase Media Base 1.0.x-dev, PHP 8.4.

Proposed resolution

Add a Remote audio media type on Drupal core's own oEmbed source, mirroring the core Remote video type exactly, so it is familiar and carries no new dependency:

  • media.type.remote_audio, source oembed:video, providers SoundCloud, Spotify and Mixcloud.
  • field.storage.media.field_media_oembed_audio and its field on the bundle, a string field holding the episode URL.
  • Default and Media library form displays, and default and Media library view displays.
  • The same per-role permissions this recipe already grants for remote_video, so the roles it configures can create, edit and delete remote audio too.

No new Composer requirement: everything used is Drupal core.

Depends on #3624669, which lets the recipe be applied to a site that already carries media configuration. The merge request branch is based on that issue's branch, so the two do not conflict; it will be rebased onto 1.0.x once #3624669 is merged.

Remaining tasks

  • ✅ File an issue
  • ✅ Addition/Change/Update/Fix
  • ❌ Testing to ensure no regression
  • ➖ Automated unit/functional testing coverage
  • ➖ Developer Documentation support
  • ❌ User Guide Documentation support
  • ➖ UX/UI designer responsibilities
  • ➖ Accessibility and Readability
  • ❌ Reviewed by a human
  • ❌ Code review by maintainers
  • ❌ Full testing and approval
  • ❌ Credit contributors
  • ❌ Review with the product owner
  • ❌ Update Release Notes
  • ❌ Release

User interface changes

  • A new Remote audio media type appears under Structure, Media types, and in the Media library when adding media.

API changes

  • N/A

Data model changes

  • Adds the remote_audio media bundle and the field_media_oembed_audio string field on it. Nothing existing changes.

Release notes snippet

  • Added a Remote audio media type for audio hosted on an external service such as SoundCloud, Spotify or Mixcloud, on Drupal core's oEmbed source.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

rajab natshah created an issue. See original summary.

  • rajab natshah committed c67c2329 on 1.0.x
    feat: #3624670 Add a Remote audio media type for externally hosted audio
    
rajab natshah’s picture

Status: Active » Fixed

The Remote audio media type is in the 1.0.1 release: https://www.drupal.org/project/varbase_media_base/releases/1.0.1

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

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

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.