Skip to content

Commit

Permalink
add stream +
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeiel Lima Miranda authored Jan 16, 2025
1 parent 571e327 commit d18e512
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 21 deletions.
32 changes: 18 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
> [!NOTE]
> Contribuição simples, para adicionar mais streams, você pode está editando o arquivo `streams.js`.
> Contribuição simples, para adicionar mais streams, você pode estar editando o arquivo "streams.js".
> ```js
> const categories = {
> Ambientes: [
> "http://radio.stereoscenic.com/ama-h",
> "http://radio.stereoscenic.com:80/am-h.mp3",
> "http://163.172.169.217:80/asp-s",
> "http://radio.stereoscenic.com:80/am-l.mp3",
> ],
> Jazz: [
> "http://icecast.radiofrance.fr/fip-midfi.mp3",
> "https://icecast.radiofrance.fr/fipjazz-midfi.mp3",
> "https://icecast.radiofrance.fr/fipgroove-midfi.mp3",
> ],
> Eletronica: ["http://nl.ah.fm:8000/live", "http://fr2.ah.fm:8000/live"],
>};
> Ambientes: [
> "http://radio.stereoscenic.com/ama-h",
> "http://radio.stereoscenic.com:80/am-h.mp3",
> "http://163.172.169.217:80/asp-s",
> "http://radio.stereoscenic.com:80/am-l.mp3"
> ],
> Jazz: [
> "http://icecast.radiofrance.fr/fip-midfi.mp3",
> "https://icecast.radiofrance.fr/fipjazz-midfi.mp3",
> "https://icecast.radiofrance.fr/fipgroove-midfi.mp3"
> ],
> Eletronica: [
> "http://nl.ah.fm:8000/live",
> "http://fr2.ah.fm:8000/live"
> ]
> };
> ```
![](/assets/image.png)
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
<option value="Ambientes">Ambientes</option>
<option value="Jazz">Jazz</option>
<option value="Eletronica">Eletronica</option>
<option value="Clássica">Clássica</option>
<option value="Oriental">Oriental</option>
</select>
</div>

Expand Down
33 changes: 26 additions & 7 deletions streams.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,31 @@ const categorySelect = document.getElementById("category-select");

const categories = {
Ambientes: [
"http://radio.stereoscenic.com/ama-h",
"http://radio.stereoscenic.com/ama-s",
"http://radio.stereoscenic.com/ama-h",
"http://radio.stereoscenic.com/asp-h3",
"https://radio.stereoscenic.com/ama-h",
"https://radio.stereoscenic.com/ama-s",
"https://radio.stereoscenic.com/ama-h",
"https://radio.stereoscenic.com/asp-h3",
"https://144.76.106.52:7000/chillout.mp3",
],
Jazz: [
"http://icecast.radiofrance.fr/fip-midfi.mp3",
"https://icecast.radiofrance.fr/fip-midfi.mp3",
"https://icecast.radiofrance.fr/fipjazz-midfi.mp3",
"https://streamingv2.shoutcast.com/djdavesessions?icy=https",
"https://icecast.radiofrance.fr/fipgroove-midfi.mp3",
],
Eletronica: [
"http://nl.ah.fm:8000/live",
"http://fr2.ah.fm:8000/live",
"https://144.76.106.52:7000/electronic.mp3",
"https://144.76.106.52:7000/psytrance.mp3?type=http&nocache=497905",
"http://51.68.153.140:9041/1?type=http&nocache=46415",
"https://144.76.106.52:7000/techno.mp3?type=http&nocache=498099",
"https://ice3.somafm.com/groovesalad-128-mp3",
],
Clássica: [
"https://everestpanel.lowcoststream.com:7135/;?icy=https",
],
Oriental:
[
"https://t4.bcbits.com/stream/a02589df14e2b8e781d81f2c203ff5bb/mp3-128/2693102669?p=0&ts=1737120943&t=3b6c9acd5fcd18cd04ef736b415ad8f2926ee2e0&token=1737120943_41d2abae470a59ea22380aae00af4df6206b93bc"
],
};

Expand All @@ -41,6 +53,13 @@ function playTrack(index) {
}
}

audio.addEventListener('ended', () => {
if (currentCategory === categories.Oriental) { // Apenas para Oriental
currentTrackIndex = (currentTrackIndex + 1) % currentCategory.length;
playTrack(currentTrackIndex);
}
});

function pauseTrack() {
try {
audio.pause();
Expand Down

0 comments on commit d18e512

Please sign in to comment.