mirror of
https://gitlab.crans.org/nounous/ghostream.git
synced 2024-12-22 09:12:19 +00:00
Update connection indicator
This commit is contained in:
parent
2085d13c0d
commit
e74acf04f7
@ -52,7 +52,16 @@ export function initViewerPage(stream, viewersCounterRefreshPeriod, posterUrl) {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
player.on("stateChanged", function (prevstate, newstate) {
|
||||||
|
if (newstate === "loading") {
|
||||||
|
document.getElementById("connectionIndicator").style.fill = '#ffc107'
|
||||||
|
}
|
||||||
|
if (newstate === "ready" || newstate === "play") {
|
||||||
|
document.getElementById("connectionIndicator").style.fill = '#28a745'
|
||||||
|
}
|
||||||
|
})
|
||||||
player.on("error", function (error) {
|
player.on("error", function (error) {
|
||||||
|
document.getElementById("connectionIndicator").style.fill = '#dc3545'
|
||||||
if (error.code === 501 || error.code === 406) {
|
if (error.code === 501 || error.code === 406) {
|
||||||
// Clear messages
|
// Clear messages
|
||||||
const errorMsg = document.getElementsByClassName("op-message-text")[0]
|
const errorMsg = document.getElementsByClassName("op-message-text")[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user