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
This commit is contained in:
infinite-persistence 2022-06-10 14:10:23 +08:00
parent b12fe2192b
commit 4c804af02c
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -208,7 +208,7 @@ const VideoJsEvents = ({
navigator.mediaSession.metadata = new window.MediaMetadata({ navigator.mediaSession.metadata = new window.MediaMetadata({
title: claimValues.title, title: claimValues.title,
artist: channelTitle, artist: channelTitle,
artwork: [{ src: claimValues.thumbnail.url }], artwork: claimValues?.thumbnail?.url ? [{ src: claimValues.thumbnail.url }] : undefined,
}); });
// $FlowFixMe // $FlowFixMe