Skip to content

MediaSession usage of the iframe widget. (ios) #502

@numeroflip

Description

@numeroflip

Hi,

I'm trying to embed a soundcloud iframe inside a react-native application, and it works very well.
On IOS however, the system controls are showing a title: "Soundcloud Widget"

Image

Do you know where that title might be coming from?

Note: I was able to update the title by updating the MediaSession metadata inside the iframe ( We can inject JS into the iframe on ios ).
But this method is not stable, every once in a while it goes back to "Soundcloud Widget"

I'm trying to figure out what's happening.
My current assumption is, that you are updating the MediaSession inside the iframe as well. If so, do you have a default "Soundcloud Widget" title?

If that is the case, would you be open to set the mediaSession metadata to the track information inside the iframe? Title, and possibly artwork

If that assumption is wrong, maybe somewhere else you have a "Soundcloud Widget" value, which ios is using.
Do you have any ideas?

Example react-native code:

      const soundcloudURL = "your soundcloud url"
      // ... 
          <WebView
            source={{html: `
               <!DOCTYPE html>
                <html>
                  <head>
                    <meta charset="UTF-8" />
                    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
                    <style>
                      * { margin: 0; padding: 0; box-sizing: border-box; }
                      html, body { height: 100%; width: 100%; overflow: hidden; }
                      iframe { border: none; width: 100%; height: 100%; display: block; }
                    </style>
                  </head>
                  <body>
                    <iframe  src="${url}" allow="autoplay" />
                  </body>
                </html>
           `}}
        />
  // OR 
     <WebView source={{uri: url}} />

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions