forked from boyska/radiomanifest.js
simple UI to test player with pickURLs
This commit is contained in:
parent
935fc70e99
commit
e1e740dbf0
2 changed files with 16 additions and 0 deletions
|
@ -7,5 +7,9 @@
|
|||
<script src="libs/ical.min.js"></script>
|
||||
<script src="dist/radiomanifest-oldstyle.bundle.js"></script>
|
||||
<script src="ui.js"></script>
|
||||
<div id="player">
|
||||
<audio controls>
|
||||
</audio>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
12
ui.js
12
ui.js
|
@ -4,8 +4,20 @@ async function fai () {
|
|||
// 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()
|
||||
|
|
Loading…
Reference in a new issue