diff --git a/web/media/encrypted-multimedia.react.js b/web/media/encrypted-multimedia.react.js --- a/web/media/encrypted-multimedia.react.js +++ b/web/media/encrypted-multimedia.react.js @@ -5,6 +5,7 @@ import 'react-circular-progressbar/dist/styles.css'; import { AlertCircle as AlertCircleIcon } from 'react-feather'; +import { useCommServicesAuthMetadata } from 'lib/hooks/account-hooks.js'; import type { EncryptedMediaType } from 'lib/types/media-types.js'; import { fetchAndDecryptMedia } from './encryption-utils.js'; @@ -42,6 +43,7 @@ const [source, setSource] = React.useState(null); const videoRef = React.useRef(null); + const authMedatata = useCommServicesAuthMetadata(); React.useEffect(() => { let isMounted = true, @@ -49,7 +51,11 @@ setSource(null); const loadDecrypted = async () => { - const { result } = await fetchAndDecryptMedia(blobURI, encryptionKey); + const { result } = await fetchAndDecryptMedia( + blobURI, + encryptionKey, + authMedatata, + ); if (!isMounted) { return; } @@ -71,7 +77,7 @@ URL.revokeObjectURL(uriToDispose); } }; - }, [blobURI, encryptionKey]); + }, [blobURI, encryptionKey, authMedatata]); // we need to update the video source when the source changes // because re-rendering the element wouldn't reload parent