1
0
Fork 0
radiomanifest.js/ui.js
2022-01-29 23:00:37 +01:00

22 lines
656 B
JavaScript

// const radiomanifest = require('radiomanifest.js')
async function fai () {
const radio = await radiomanifest.get('http://www.ondarossa.info/')
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()