Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Media player cover url #12

Open
bobvandevijver opened this issue Feb 29, 2024 · 4 comments
Open

Media player cover url #12

bobvandevijver opened this issue Feb 29, 2024 · 4 comments

Comments

@bobvandevijver
Copy link
Contributor

I am trying to get the media player cover URL to work, but currently I am hitting two apparent bugs.

Code snippet:

new FreeAtHome().createMediaPlayerDevice('id', 'name')
  .then(device => {
    // https://gist.github.com/ondrek/7413434?permalink_comment_id=3914686#gistcomment-3914686
    const sourceUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAIAQMAAAD+wSzIAAAABlBMVEX///+/v7+jQ3Y5AAAADklEQVQI12P4AIX8EAgALgAD/aNpbtEAAAAASUVORK5CYII';

    // Blue block
    // const sourceUrl = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAFUlEQVR42mNkYPhfz0AEYBxVSF+FAP5FDvcfRYWgAAAAAElFTkSuQmCC';

    // Actual URL
    // const sourceUrl = "https://cdn-profiles.tunein.com/s67814/images/logoq.jpg?t=637596572990000000"

    // Base 64 of actual url
    // const sourceUrl = 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUFBQUFBQUGBgUICAcICAsKCQkKCxEMDQwNDBEaEBMQEBMQGhcbFhUWGxcpIBwcICkvJyUnLzkzMzlHREddXX0BBQUFBQUFBQYGBQgIBwgICwoJCQoLEQwNDA0MERoQExAQExAaFxsWFRYbFykgHBwgKS8nJScvOTMzOUdER11dff/AABEIAJEAkQMBIgACEQEDIgH/xACwAAEAAgMBAQEAAAAAAAAAAAAABgcEBQgBAwIQAAEEAQMCAgMIDgsAAAAAAAABAgMEBQYREgcxEyFBYXEUIjI2c5OxshUXNDVRUlZydIGSlNLhFiMlJjdCQ0RU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Vc9y7IiIqqvsRCXY3S0snGW85Y2+iNPhL7V7ISuhiqWObtDF7/s6RfNymyN3baZCG2VXmX0+x0i7vqFhRnUuKsYRiuW2cN6t8YKFrvt9Gj5lTt5/yOJ9R9b651HVaubqUaeeIIh0sTljLb92Y9etBUjSOCJrGJ6G/Sq+lTIANrGKisKPBt9X1vUtZuXXvbuVSbecGobm5b5BbYviHIzufzYABUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAj+N09To8Xyf1034zk8kX1ISAAx0qVOjHbTjtR1PqnxR1rqDMLWo7e2feCOYVJ1ak3Nycm+7byWJ8Yg8FuH2b/ABAAMhUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH/2Q==';

    device.setCoverUrl(sourceUrl);
  });

Using an actual, external URL doesn't work (http doesn't make a difference). I am greeted by an error in the browser console notifying that the request has been blocked. Not only has the URL been converted to http://localhost:0/s67814/images/logoq.jpg?t=637596572990000000, but it also looks like the CSP would have blocked it even if the URL would have been correct. Even if the CS would not block these items, it can still break when images must be sourced from an internal address which might not be available from the device the interface is rendered from.

image

Using the base64 encoded images I have more success, but when I try to use something that is larger than a couple of pixels, I am greeted by an Free@Home error notifying me that the data is too large:

Request error: Generic Error: status: 413; status text: Payload Too Large; body: undefined

So the real question: is there a way of storing a file somewhere on the SysAp which generates a certain URL that can be used there?

@StefanGuelland
Copy link
Contributor

At the moment, covers are only supported by the apps for Android and iOS.
The web interface is not yet able to display covers.

@bobvandevijver
Copy link
Contributor Author

While it does indeed work in the mobile app for public URLs, this is still an issue for URLs that require some sort of authentication or retrieval from the internal player.

@StefanGuelland
Copy link
Contributor

StefanGuelland commented Jul 16, 2024

Support for authentication when downloading covers is not available and not planned.

If you need something like that you could try to proxy the request from inside an addon and add authentication in the proxy.

@bobvandevijver
Copy link
Contributor Author

Looks like the app already proxies the request for the mobile app, as it does seem to work when not on the same network. This means that only the issue in with the web interface stands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants