Skip to content

Commit

Permalink
Merge pull request #7 from spike886/master
Browse files Browse the repository at this point in the history
Prevent the constant loading of the image when playing content
  • Loading branch information
bradcrc authored Jan 4, 2022
2 parents aacd957 + 3b51de8 commit 3efe256
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions now-playing-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,14 @@ class NowPlayingPoster extends HTMLElement {
}
else
{
this.content.innerHTML = `
<!-- now playing card ${entityId} -->
<img src="${movposter}" width=100% height=100%">
`;
const img = new Image();
img.onload = () => {
this.content.innerHTML = `
<!-- now playing card ${entityId} -->
<img src="${movposter}" width=100% height=100%">
`;
};
img['src']= movposter
}
}
else
Expand Down

0 comments on commit 3efe256

Please sign in to comment.