diff --git a/src/cards/ha-media_player-card.html b/src/cards/ha-media_player-card.html
index 31f3da3d7a..50d1c90df7 100644
--- a/src/cards/ha-media_player-card.html
+++ b/src/cards/ha-media_player-card.html
@@ -238,23 +238,23 @@ class HaMediaPlayerCard extends window.hassMixins.EventsMixin(Polymer.Element) {
var dummy;
if (picture) {
dummy = document.createElement('IMG');
- dummy.onload = function () {
+ dummy.onload = () => {
this.$.cover.style.backgroundImage = 'url(' + picture + ')';
dummy.onerror = dummy.onload = null;
dummy.src = '';
dummy = null;
- }.bind(this);
- dummy.onerror = function () {
+ };
+ dummy.onerror = () => {
this.$.cover.style.backgroundImage = '';
- this.toggleClass('no-cover', true, this.$.cover.parentElement);
+ this.$.cover.parentElement.classList.add('no-cover');
dummy.onerror = dummy.onload = null;
dummy.src = '';
dummy = null;
- }.bind(this);
+ };
if (this._timeout_id) {
clearTimeout(this._timeout_id);
}
- this._timeout_id = setTimeout(function () {
+ this._timeout_id = setTimeout(() => {
if (dummy) {
// Background load still inflight. Clear real image.
this.$.cover.style.backgroundImage = '';