From 4c804af02c938862750a6bb4191e4351659967a1 Mon Sep 17 00:00:00 2001 From: infinite-persistence Date: Fri, 10 Jun 2022 14:10:23 +0800 Subject: [PATCH] MediaSession: handle null thumbnail The exception thrown was causing the rest of `onInitPlay` to not run, e.g. "Tap to mute" not appearing, etc. Closes 1663 --- ui/component/viewers/videoViewer/internal/videojs-events.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/component/viewers/videoViewer/internal/videojs-events.jsx b/ui/component/viewers/videoViewer/internal/videojs-events.jsx index 370cfbb47..ac019ae5f 100644 --- a/ui/component/viewers/videoViewer/internal/videojs-events.jsx +++ b/ui/component/viewers/videoViewer/internal/videojs-events.jsx @@ -208,7 +208,7 @@ const VideoJsEvents = ({ navigator.mediaSession.metadata = new window.MediaMetadata({ title: claimValues.title, artist: channelTitle, - artwork: [{ src: claimValues.thumbnail.url }], + artwork: claimValues?.thumbnail?.url ? [{ src: claimValues.thumbnail.url }] : undefined, }); // $FlowFixMe