I tested with https://media-chrome.mux.dev/examples/vanilla/themes/tailwind-audio-theme.html
If the player connects to the live stream (user clicks play button) and then gets disconnected (streaming server goes down, or the stream itself stops):
a) the audio element reports: console.log(Error code: ${aud.error.code}; msg: ${aud.error.message}) //Error code: 4; msg: Failed to open media
b) the play button changes from pause back to play
Then, if the server and stream are back online, when you click the play button nothing happens.
This is the code I put in the console of that webpage to test:
let aud = document.getElementsByTagName('audio')[0]
aud.setAttribute('preload',"none")
aud.onplay = () => {console.log("play it sam")}
aud.onready = () => { console.info("onready") }
aud.onwaiting = () => {console.info("onwaiting") }
aud.onplaying = () => {console.info("onplaying" ) }
aud.onerror = () => {
console.info("error on player" )
console.log(`Error code: ${aud.error.code}; msg: ${aud.error.message}`)
}
aud.onstalled = () => {console.info("onstalled") }
aud.onpause = () => {console.info("onpause") }
aud.onabort = () => { console.info("onabort") }
aud.onloadstart = () => { console.info("onloadstart") }
aud.onsuspend = () => { console.info("onsuspend") }
aud.onended = () => { console.info("onended"); aud.load()}
aud.oncanplaythrough = () => { console.info("oncanplaythrough") }
aud.src="https://host_of_my_server.org/live.oga"
LIKEWISE, if you the server is not online when you first press play, the play button gets stuck on the pause button and it won't toggle back to play. So, when the player hits error code 4, it seems, it gets stuck.
I tested with https://media-chrome.mux.dev/examples/vanilla/themes/tailwind-audio-theme.html
If the player connects to the live stream (user clicks play button) and then gets disconnected (streaming server goes down, or the stream itself stops):
a) the audio element reports:
console.log(Error code: ${aud.error.code}; msg: ${aud.error.message}) //Error code: 4; msg: Failed to open mediab) the play button changes from pause back to play
Then, if the server and stream are back online, when you click the play button nothing happens.
This is the code I put in the console of that webpage to test:
LIKEWISE, if you the server is not online when you first press play, the play button gets stuck on the pause button and it won't toggle back to play. So, when the player hits error code 4, it seems, it gets stuck.