surekap / MMM-ShairportMetadata

AirTunes metadata module for MagicMirror
MIT License
18 stars 11 forks source link

Title & Album Marquee Scrolls across entire screen #1

Open LexJackson opened 7 years ago

LexJackson commented 7 years ago

In the latest version of MM the Marquee for Title and Artist scroll across the entire screen from right to left instead of staying tight within the region space. As a temporary stop-gap, as I am not really a coder, I adjusted the if-else statement for title length to 100 from 30 and conversely the Album Name from 50 to 100 (see below). This stopped the marquee effect for most things. Just want to say thanks to surekap for writing this! I like having the info pop up on the MM. I really appreciate your work on this.

In MMM-ShairportMetadata.js I edited:

if (this.metadata['Title'] && this.metadata['Title'].length > 100){ titletag = document.createElement("marquee"); titletag.setAttribute('loop', '-1'); }else{ titletag = document.createElement("div"); }

  titletag.innerHTML = (this.metadata['Title']) ? this.metadata['Title'] : "";
  titletag.className = "bright";
  metadata.appendChild(titletag)

  var txt = "";
  if (this.metadata['Artist'] || this.metadata['Album Name']){
      txt = this.metadata['Artist'] + " - " + this.metadata['Album Name']
  }
  if (txt.length > 100){
      artisttag = document.createElement('marquee');
      artisttag.setAttribute("loop", '-1')
  }else{
      artisttag = document.createElement('div');
dxfan227 commented 5 years ago

I am having a related issue. Whenever a larger title is loaded the entire module shift position to the left....any idea why?

XoniBlue commented 4 years ago

same as above when a larger song title is played the "somebody is playing" keeps shifting to the left as well as the entire module