The url scraped from a music player always produces a broken image icon (middle of pic).
If I input the url in manually and then run the module it will display the image (see comment at the top of the pic).
If I don’t put in a url I get an outline with no broken image icon.
I can output the url as a string on the screen (middle of pic and code)
I can check the url from the music players web interface (bottom of pic).
Could someone please tell me how to the url into image.src from data[‘albumart’]. This has been bugging me for 2 full days now.
var data = this.volumioData;
var item = document.createElement('div');
var image = document.createElement('img');
image.src = data['albumart']; // If I replace this with the url it will display the image
image.height = 450;
image.width = 450;
image.className = 'image';
item.className = 'mmm-volumio-item';
item.innerHTML = '<div>' + data['artist'] + ' • ' + data['album'] +
'</div>' + '<div>' + data['albumart'] + '</div>';//I put 'albumart' here to prove I had the url
wrapper.appendChild(item);
wrapper.appendChild(image);
return wrapper;
}
});
I am modifying MMM-Volumio to show the Album Covers what is playing. I can’t program in Java but have done a tiny bit in C++,Pascal,Visual Basic and Python. I am sorry if my code is really bad (all 4 lines of it that took me 2 days), it is working except for the url problem. I will also do a better layout when it is working.