2021-11-19 18:08:09 +01:00
|
|
|
// const radiomanifest = require('radiomanifest.js')
|
|
|
|
async function fai () {
|
2021-12-05 16:58:20 +01:00
|
|
|
const radio = await radiomanifest.get('http://www.ondarossa.info/')
|
2021-11-19 18:08:09 +01:00
|
|
|
console.log('radio?', radio)
|
|
|
|
const s = radio.getStreaming()
|
2021-12-26 20:00:47 +01:00
|
|
|
console.log(s.sources)
|
2021-11-19 18:08:09 +01:00
|
|
|
console.log(s.getOptions())
|
|
|
|
console.log(s.getSource(s.getOptions()[0]))
|
2021-12-26 20:00:47 +01:00
|
|
|
console.log(s.getSource())
|
|
|
|
|
|
|
|
var audioEl = document.querySelector('#player audio')
|
|
|
|
var urls = await s.pickURLs()
|
|
|
|
console.log('audios', urls)
|
|
|
|
urls.forEach( function(url) {
|
|
|
|
var srcEl = document.createElement("source")
|
|
|
|
srcEl.setAttribute('src', url)
|
|
|
|
console.log('src', srcEl, url)
|
|
|
|
audioEl.appendChild(srcEl)
|
|
|
|
})
|
2021-11-16 23:22:16 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
fai()
|