UNPKG

@snap/camera-kit

Version:
29 lines (21 loc) 949 B
[**CameraKit Web SDK v1.17.0**](../README.md) *** [CameraKit Web SDK](../globals.md) / LensVideoPlaybackMutedError # Type Alias: LensVideoPlaybackMutedError > **LensVideoPlaybackMutedError**: `NamedError`\<`"LensVideoPlaybackMutedError"`\> This error occurs when a Lens attempts to play video, but the browser blocks audio playback due to autoplay policies. The video will still play, but in a muted state. Applications should handle this error by showing an unmute button or similar UI element, allowing the user to interact with the page and then unmute audio. ```ts cameraKitSession.events.addEventListener('error', ({ detail }) => { if (detail.error.name === 'LensVideoPlaybackMutedError') { // Show an unmute button that calls session.unmute() on user interaction unmuteButton.style.display = 'block' unmuteButton.onclick = () => { cameraKitSession.unmute() unmuteButton.style.display = 'none' } } }) ```