Skip to content

Commit efbe2f8

Browse files
committed
added details on custom event
1 parent 171350b commit efbe2f8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

edirom-audio-player.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ class EdiromAudioPlayer extends HTMLElement {
146146

147147
// custom event for property update
148148
const event = new CustomEvent('communicate-' + property + '-update', {
149-
detail: { [property]: newPropertyValue },
149+
detail: {
150+
element: this.tagName.toLowerCase(),
151+
property: property,
152+
value: newPropertyValue
153+
},
150154
bubbles: true
151155
});
152156
this.dispatchEvent(event);
@@ -620,7 +624,11 @@ class EdiromAudioPlayer extends HTMLElement {
620624

621625
// Send update event to host
622626
const event = new CustomEvent('communicate-time-update', {
623-
detail: { time: audioPlayer.currentTime },
627+
detail: {
628+
element: this.tagName.toLowerCase(),
629+
property: 'time',
630+
value: audioPlayer.currentTime
631+
},
624632
bubbles: true
625633
});
626634
this.dispatchEvent(event);

0 commit comments

Comments
 (0)