From e1e740dbf0464ec97c3ea75f5a3ec2ac5d0d8b72 Mon Sep 17 00:00:00 2001 From: boyska Date: Sun, 26 Dec 2021 20:00:47 +0100 Subject: [PATCH] simple UI to test player with pickURLs --- index.html | 4 ++++ ui.js | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/index.html b/index.html index b1d3934..cae5736 100644 --- a/index.html +++ b/index.html @@ -7,5 +7,9 @@ +
+ +
diff --git a/ui.js b/ui.js index 90c09bc..819ad0e 100644 --- a/ui.js +++ b/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()