Unable to change Oembed visual parameter

Since yesterday, we had a problem with embedding a soundcloud player. We use the Oembed method, but it seems that not all parameters can be manipulated. So, now we get a new visual player instead of the old one.

For example, when we use: http://soundcloud.com/oembed?format=xml&url=https://soundcloud.com/radionetherlands/el-toque-educacion-sexual-a-la&visual=false

You see that the html node in xml now contains 2 times the visual parameter

<oembed>
    <version type="float">1.0</version>
    <type>rich</type>
    <provider-name>SoundCloud</provider-name>
     <provider-url>http://soundcloud.com</provider-url>
     <height type="integer">400</height>
     <width>100%</width>
     <title>El Toque: Educacion sexual a la mexicana by Radio Netherlands</title>
    <description>"Cuando nos deje de dar verguenza que un niño nos pregunte de dónde vienen los bebés, podremos decir que estamos en buen camino en materia de educación sexual", decía una participante en el Noveno Congreso Mexicano de Educación Sexual y sexología FEMESS, realizado recientemente en Aguascalientes, México. Hasta allá se hizo presente El Toque, donde nuestra colega Mara Landa conversó, entre otros, con Marcela Martínez, la presidenta de la Federación Mexicana de Educación Sexual y Sexualidad FEMESS y Erem Dira, voluntaria del comité organizador del congreso. Producción Mara Landa. Presentación Alejandro Pintamalli.</description>
    <thumbnail-url>http://i1.sndcdn.com/artworks-000061844084-068ssp-t500x500.jpg?e30f094</thumbnail-url>
    <html><![CDATA[<iframe width="100%" height="400" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?visual=true&url=http%3A%2F%2Fapi.soundcloud.com%2Ftracks%2F118490723&show_artwork=true&visual=false"></iframe>]]></html>
    <author-name>Radio Netherlands</author-name>
    <author-url>http://soundcloud.com/radionetherlands</author-url>
</oembed>
+4
source share
3 answers

, SoundCloud oEmbed. , , oEmbed . , API, .

, . iframe, DOM. oEmbed.

if (oEmbed) $('#player').html(oEmbed.html.replace('visual=true&',''));

+5

- , jquery . , , visual = true '' false. iframes soundcloud.

$(document).ready(function(){
$("iframe").each(function() {
    var src = $(this).attr('src');
    if(src.indexOf('https://w.soundcloud.com/player/?') != -1 && src.indexOf('visual=true') != -1) {
        $(this).attr('src', src.replace('visual=true', ' '));
    }
});
});

EDIT: , , show_artwork !

0

There is a way to change. Someone asked SoundCloud on Twitter, and since then he has referenced many times.

Change visual=trueto visual=falseand show_artwork=trueto show_artwork=false. That should take care of this!

Src: https://twitter.com/16kbit/status/430477602286239744

Hope this helps.

-1
source

Source: https://habr.com/ru/post/1524380/