1
0
Fork 0
radiomanifest.js/ui.js

23 lines
749 B
JavaScript

// const radiomanifest = require('radiomanifest.js')
async function fai () {
const radio = await radiomanifest.get('http://www.ondarossa.info/')
// var radio = await get("https://boyska.degenerazione.xyz/radiomanifest/examples/empty/")
console.log('radio?', radio)
const s = radio.getStreaming()
console.log(s.sources)
console.log(s.getOptions())
console.log(s.getSource(s.getOptions()[0]))
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)
})
}
fai()