mirror of
https://github.com/sist2app/sist2.git
synced 2026-03-29 11:31:35 +00:00
Pause all other audio tags on play #148
This commit is contained in:
@@ -350,6 +350,14 @@ function createDocCard(hit) {
|
|||||||
audio.setAttribute("controls", "");
|
audio.setAttribute("controls", "");
|
||||||
audio.setAttribute("type", hit["_source"]["mime"]);
|
audio.setAttribute("type", hit["_source"]["mime"]);
|
||||||
audio.setAttribute("src", "f/" + hit["_id"]);
|
audio.setAttribute("src", "f/" + hit["_id"]);
|
||||||
|
audio.addEventListener("play", () => {
|
||||||
|
// Pause all currently playing audio tags
|
||||||
|
$("audio").each(function(){
|
||||||
|
if (this !== audio) {
|
||||||
|
this.pause();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
docCard.appendChild(audio)
|
docCard.appendChild(audio)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user