TL;DR bolded question at the bottom
So I've spent the better part of the day trying to figure out if I can link a streaming URL to the HTML5 Audio element, and I couldn't tell from the spec. This line from the spec (when describing the audio
element was interesting:
src — Address of the resource
And so it doesn't look like it has to be a static path. However, everything else I've read from SO answers, to different parts of the spec, it was inconclusive, so I just decided to try it. I grabbed different streams off this website: https://lrn.fm/listen/online/ and decided to just stick things in the audio src. Here is my code for the audio element:
<audio src='https://streams.lrn.fm:8110' controls></audio>
And this is the error message I get in the JS console in Chrome 71 on Mac Mojave (running a test webserver on XAMPP with the default configs pretty much):
GET https://streams.lrn.fm:8110/ net::ERR_CONNECTION_CLOSED
This is the error message I get when I replace the above src
with this src (https://s2.voscast.com:7392):
GET https://s2.voscast.com:7392/ net::ERR_CONNECTION_RESET
So it doesn't look like the audio element accepts a streaming URL as a source. Is this true, or am I doing something wrong?
To me, it looks like the browser won't accept anything over a non-standard port when GETting over HTTPS. Is that way off base? Pretty much, this is the question:
Does the HTML5 Audio element accept a remote server address in the src
attribute?