mirror of
https://github.com/simon987/sist2.git
synced 2025-04-10 14:06:45 +00:00
Pause all other audio tags on play #148
This commit is contained in:
parent
50771bd1dc
commit
707a570828
@ -350,6 +350,14 @@ function createDocCard(hit) {
|
||||
audio.setAttribute("controls", "");
|
||||
audio.setAttribute("type", hit["_source"]["mime"]);
|
||||
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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user