From 57095a47c4c3c2e8615854436c7770e7ee101197 Mon Sep 17 00:00:00 2001 From: piotrruss Date: Fri, 24 Jan 2025 19:14:32 +0100 Subject: handle errors in player --- README.md | 1 - apps/Player/components/Video.js | 10 ++++++++++ configs/dbConnect.js | 3 ++- configs/translations.js | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 23898cd..beddde4 100644 --- a/README.md +++ b/README.md @@ -89,4 +89,3 @@ In the app menu user has following options (from the left): Screenshot: ![Game of life](screenshot.jpg) - 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 }) <>