Problem/Motivation

Out of the box, if you add a remote audio item from Soundcloud, the iframe showing it is 100px wide.

soundcloud iframe

This isn't exactly a bug, because everything works as expected, but it looks odd, and it is may not be immediately obvious how to fix it.

This can be addressed by the following steps:

1. go to /admin/structure/media/manage/remote_audio/display
2. click the cog to edit the oEmbed settings
3. select a maximum width e.g. 800px

Strangely, the Spotify iframe looks fine -
spotify iframe

Steps to reproduce

1. enable the module
2. add a Soundcloud item, e.g. https://soundcloud.com/dj-jo-public/jo-public-logical-obsession-09-dec-2...

Proposed resolution

tbc - possibly just documentation?

CommentFileSizeAuthor
spotify.jpg26.35 KBmalcomio
soundcloud-100px.jpg73.53 KBmalcomio

Comments

malcomio created an issue. See original summary.

chris matthews’s picture

Assigned: Unassigned » phenaproxima
chris matthews’s picture

@malcomio, this should be able to be solved by either:

1) having the module expose a config option for minimum SoundCloud embed width, and then apply that width to SoundCloud embeds only

OR

2) having the module always set the max_width option on displays for remote_audio, which is the easier of the two fixes, and would work just as well.

I'm not sure when a fix can get in a stable release so in the meantime your suggested workaround is best.

pancho’s picture

Project: Media Remote Audio (oEmbed) » Drupal core
Version: 1.0.x-dev » main
Component: User interface » media system
Category: Task » Feature request
Related issues: +#3641566: Fix query string and fragment handling in oEmbed and update URLs

SoundCloud's oEmbed endpoint returns a width of "100%", which does not comply with the oEmbed specification:

{
  "type": "rich",
  "width": "100%",
  "height": 400
}

In #3641566: Fix query string and fragment handling in oEmbed and update URLs, the same is demonstrated for hearthis.at.

Some oEmbed consumers appear to handle percentage-based widths gracefully, although the specification requires the width to be expressed in pixels.

Drupal however casts "100%" to integer 100, resulting in an iframe that is only 100 pixels wide.