Code: [Local Link Removed for Guests]
DIM url$(5) ' internet broadcasting stations
url$(0) = "http://listen.shoutcast.com/thegreatamericansongbook" 'American Song
url$(1) = "http://62.27.87.143/crtve/rnerc/main/mp3/high" ' Radio nacional clasica
url$(2) = "http://37.252.124.170:8010/adagioradio.mp3"
url$(3) = "http://23.106.34.27:24929/stream" ' The UK 1940s Radio Station Server
url$(4) = "http://64.40.99.76:8000/" ' Beatles Radio
url$(5) = "http://192.96.201.2:8000/;?icy=http" ' Italian 60_70
emi$ = "American,Clasica,Adagio,Los_40,Beatles,Italian" ' for listBox options
sel$ = ""
info$ = "" ' for streaming metadata
vol = 70 : vol$ = str$(vol) + "%"
status$ = "OFF"
htmlEventVar$ = ""
onplay laut ' when receiving streaming metadata
onHtmlReload web ' when the web page reloads
onHtmlChange sel ' when the web page changes
gosub web
gosub sel
wait ' wait for some event
END
' ---------------------------------------------------------------------------------------------------
web:
cls
cssexternal "/style.css"
a$ = ""
a$ = |<center><h2 style="margin-top:25px;font-family:Tahoma;font-size:1.8rem;">Streaming Radio</h2>|
a$ = a$ + |Station:| + listBox$(sel$, emi$, "box")
a$ = a$ + textArea$(info$,"info")
a$ = a$ + |Volume: | + textBox$(vol$,"porcen")
a$ = a$ + slider$(vol, 0, 100, 5, "vol")
a$ = a$ + |Right now i'm: |
if status$ = "ON" then a$ = a$ + button$("ON",btn,"btn") else a$ = a$ + button$("OFF",btn,"btn")
a$ = replace$(a$, "Choose here", "Select:")
html a$
return
' ---------------------------------------------------------------------------------------------------
laut:
info$ = play.message$
info$=replace$(info$,"SiteName=", "Station: ")
info$=replace$(info$, "Genre=", "")
info$=replace$(info$, "Bitrate=", "Kbps: ")
info$=replace$(info$, "StreamTitle=", "")
refresh
return
' ---------------------------------------------------------------------------------------------------
btn:
if status$ = "ON" then
play.stop
info$ = ""
status$ = "OFF"
gosub web
end if
return
' ---------------------------------------------------------------------------------------------------
sel:
if htmlEventVar$ = "vol" then
vol$ = str$(vol) + "%"
play.volume vol
refresh
endif
if htmlEventVar$ = "sel$" then
index = WORD.FIND(emi$, sel$, ",")
play.setup 1, 64
play.stream url$(index-1), 15000
status$ = "ON"
gosub web
endif
return
Code: [Local Link Removed for Guests]
#box {
font-size: 1rem;
margin-left: 10px;
width: 200px;
}
#porcen {
font-size: 1.5rem;
text-align: center;
width: 15%;
border:none;
}
#vol {
display: block;
width: 75%;
max-width: 500px;
}
#info {
display: block;
font-size: 0.9rem;
width: 75%;
max-width: 500px;
height: 25%;
margin: 30px auto;
padding: 12px 26px;
background-color: yellow;
border: 1px solid #132338;
border-radius: 34px;
box-shadow: 2px 2px 2px #505F69;
}
#btn {
font-family: 'trebuchet ms';
font-weight: bold;
font-size:18px;
margin: 40px auto;
padding: 12px 26px;
border: 1px solid #132338;
border-radius:34px;
box-shadow: 2px 2px 2px #505F69;
color:#14396A !important;
background: #EEE9E4;
background: linear-gradient(to top,#EEE9E4,#B1CF7C);
}