Merge pull request #963 from alariej/navigator_mediasession_fix

Fix for Android WebView, which does not support navigator.mediaSession
This commit is contained in:
Robin 2023-03-17 13:20:05 -04:00 committed by GitHub
commit ff90e507a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -189,7 +189,7 @@ export function useGroupCall(groupCall: GroupCall): UseGroupCallReturnType {
];
for (const mediaAction of mediaActions) {
navigator.mediaSession.setActionHandler(
navigator.mediaSession?.setActionHandler(
mediaAction,
doNothingMediaActionCallback
);
@ -197,7 +197,7 @@ export function useGroupCall(groupCall: GroupCall): UseGroupCallReturnType {
return () => {
for (const mediaAction of mediaActions) {
navigator.mediaSession.setActionHandler(mediaAction, null);
navigator.mediaSession?.setActionHandler(mediaAction, null);
}
};
}, [doNothingMediaActionCallback]);