diff options
author | 2025-01-24 19:14:32 +0100 | |
---|---|---|
committer | 2025-01-24 19:14:32 +0100 | |
commit | 57095a47c4c3c2e8615854436c7770e7ee101197 (patch) | |
tree | df7b9885b2e1dda032984b35e09d53af48b60602 | |
parent | d32cd07f5e2dbe5f62618c939b8f6fd35b13d5ea (diff) | |
download | my_apps-57095a47c4c3c2e8615854436c7770e7ee101197.tar.gz my_apps-57095a47c4c3c2e8615854436c7770e7ee101197.tar.bz2 my_apps-57095a47c4c3c2e8615854436c7770e7ee101197.zip |
handle errors in player
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | apps/Player/components/Video.js | 10 | ||||
-rw-r--r-- | configs/dbConnect.js | 3 | ||||
-rw-r--r-- | configs/translations.js | 4 |
4 files changed, 16 insertions, 2 deletions
@@ -89,4 +89,3 @@ In the app menu user has following options (from the left): Screenshot:  - diff --git a/apps/Player/components/Video.js b/apps/Player/components/Video.js index 2167ee0..161191a 100644 --- a/apps/Player/components/Video.js +++ b/apps/Player/components/Video.js @@ -16,6 +16,15 @@ const Video = ({ playlist, current, setCurrent, audioOnly = false, setDetails }) setCurrent(current === playlist.length - 1 ? null : current + 1) } + const handleError = () => { + setPopup({ + content: t('player_youtube_no_stream_error') + playlist[current].title, + time: 2000, + error: true + }) + handleEnd() + } + useEffect(() => { setLoading(true) if (current === null) { @@ -85,6 +94,7 @@ const Video = ({ playlist, current, setCurrent, audioOnly = false, setDetails }) <> <video onEnded={handleEnd} + onError={handleError} ref={videoEl} key={data.id} controls diff --git a/configs/dbConnect.js b/configs/dbConnect.js index 8dd7e0b..b6a87a2 100644 --- a/configs/dbConnect.js +++ b/configs/dbConnect.js @@ -31,7 +31,8 @@ async function dbConnect () { bufferCommands: false, bufferMaxEntries: 0, useFindAndModify: false, - useCreateIndex: true + useCreateIndex: true, + dbName: 'apps', } cached.promise = mongoose.connect(MONGODB_URI, opts).then((mongoose) => { diff --git a/configs/translations.js b/configs/translations.js index 617ce16..f2a3f9b 100644 --- a/configs/translations.js +++ b/configs/translations.js @@ -84,6 +84,7 @@ const translations = { player_item_playing: 'Playing in Player', player_item_enqueued: 'Enqueued in Player', player_youtube_fetching_error: 'Could not get item from Youtube', + player_youtube_no_stream_error: 'Could not load stream for ', change_password_current: 'Current password', change_password_new: 'New password', change_password_confirm: 'Confirm new password', @@ -188,6 +189,7 @@ const translations = { player_item_playing: 'Odtwarzanie w Odtwarzaczu', player_item_enqueued: 'Dodano do kolejki odtwarzania', player_youtube_fetching_error: 'Błąd pobierania z Youtube', + player_youtube_no_stream_error: 'Nie udało się załadować streamu dla ', change_password_current: 'Obecne hasło', change_password_new: 'Nowe hasło', change_password_confirm: 'Powtórz nowe hasło', @@ -292,6 +294,7 @@ const translations = { player_item_playing: 'Jugar con el Jugador', player_item_enqueued: 'Añadido a la cola de reproducción', player_youtube_fetching_error: 'Error de descarga de YouTube', + player_youtube_no_stream_error: 'No se pudo cargar la transmisión para ', change_password_current: 'Contraseña actual', change_password_new: 'Contraseña nueva', change_password_confirm: 'Repetir contraseña nueva', @@ -396,6 +399,7 @@ const translations = { player_item_playing: 'Spiele auf dem Spieler', player_item_enqueued: 'Zur Play Queue hinzugefügt', player_youtube_fetching_error: 'Fehler beim Herunterladen von YouTube', + player_youtube_no_stream_error: 'Konnte Stream nicht laden für ', change_password_current: 'Aktuelles Passwort', change_password_new: 'Neues Passwort', change_password_confirm: 'Wiederhole neues Passwort', |