<script>
document.addEventListener("DOMContentLoaded", function() {
(function () {
const playList = {
'catching-fire': 'https://310401.selcdn.ru/MIXED/hunger_games-hanging_tree.mp3',
'mockingjay1': 'https://310401.selcdn.ru/MIXED/TheHungerGames2.mp3',
'mockingjay2': 'https://310401.selcdn.ru/MIXED/LordeFlickerTheHungerGames3.mp3'
};
for (const key in playList) {
const elements = document.getElementsByClassName(key);
for (const element of elements) {
const tnAtom = element.querySelector('.tn-atom');
if (tnAtom) {
tnAtom.innerHTML = `<audio preload="metadata" controls controlsList="nodownload">
<source src="${playList[key]}" type="audio/mpeg">
</audio>`;
}
}
}
let activeTrack = {};
document.querySelectorAll('audio').forEach(function(el) {
el.addEventListener('playing', function() {
if (activeTrack.pause && activeTrack !== this) {
activeTrack.pause();
}
activeTrack = this;
});
});
})();
});
</script>
<style>
audio {
height: 40px;
width:100%;
border-radius: 30px;
box-shadow: 0 0 40px 0 rgb(62 62 62 / 44%);
}
audio::-webkit-media-controls-panel {
background: #bdbdbd;
}
</style>