spero ultimo bugfix hls mobile
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
<changelog>
|
<changelog>
|
||||||
|
|
||||||
<version>
|
<version>
|
||||||
<number>2.1.2 (b)</number>
|
<number>2.1.2 (c)</number>
|
||||||
<logs>
|
<logs>
|
||||||
<log>Correzione e bugfix di problematiche varie.</log>
|
<log>Correzione e bugfix di problematiche varie.</log>
|
||||||
</logs>
|
</logs>
|
||||||
|
|||||||
35
js/app.js
35
js/app.js
@@ -535,13 +535,40 @@ document.addEventListener('DOMContentLoaded', function () {
|
|||||||
});
|
});
|
||||||
|
|
||||||
audioPlayer.addEventListener('error', function (e) {
|
audioPlayer.addEventListener('error', function (e) {
|
||||||
console.error('Errore audio player:', e);
|
console.error('Errore audio player (Event):', e);
|
||||||
updatePlayState(false);
|
|
||||||
if (playerStatus) {
|
if (audioPlayer.error) {
|
||||||
playerStatus.textContent = 'Errore di riproduzione';
|
const err = audioPlayer.error;
|
||||||
|
console.error('Dettagli MediaError:', {
|
||||||
|
code: err.code,
|
||||||
|
message: err.message,
|
||||||
|
readableCode: getMediaErrorMessage(err.code)
|
||||||
|
});
|
||||||
|
|
||||||
|
// Mostra errore specifico all'utente se possibile
|
||||||
|
if (playerStatus) {
|
||||||
|
playerStatus.textContent = 'Errore: ' + getMediaErrorMessage(err.code);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (playerStatus) {
|
||||||
|
playerStatus.textContent = 'Errore sconosciuto';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
updatePlayState(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Helper per decodificare errori media
|
||||||
|
function getMediaErrorMessage(code) {
|
||||||
|
switch (code) {
|
||||||
|
case 1: return 'MEDIA_ERR_ABORTED (Aborted by user)';
|
||||||
|
case 2: return 'MEDIA_ERR_NETWORK (Network error)';
|
||||||
|
case 3: return 'MEDIA_ERR_DECODE (Decoding error)';
|
||||||
|
case 4: return 'MEDIA_ERR_SRC_NOT_SUPPORTED (Format not supported)';
|
||||||
|
default: return 'Unknown error code ' + code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
audioPlayer.addEventListener('waiting', function () {
|
audioPlayer.addEventListener('waiting', function () {
|
||||||
if (playerStatus) {
|
if (playerStatus) {
|
||||||
playerStatus.textContent = 'Buffering...';
|
playerStatus.textContent = 'Buffering...';
|
||||||
|
|||||||
Reference in New Issue
Block a user