[Webkit-unassigned] [Bug 236439] Audio volume reduces on stopping and restarting audio track after enabling / disabling the mic capture
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Jun 25 00:08:59 PDT 2024
https://bugs.webkit.org/show_bug.cgi?id=236439
Martin Bartlett <trunnelshine at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |trunnelshine at gmail.com
--- Comment #6 from Martin Bartlett <trunnelshine at gmail.com> ---
> Earlier issue - Audio Volume reduces considerably on accepting the mic
> permissions
> https://bugs.webkit.org/show_bug.cgi?id=218012 https://tinyfishing.world
>
> From the 15.4 beta version the earlier issue got fixed. But it reproes again
> if we enable / disable the mic permission and then minimizing and then again
> maximize the safari.
>
> Steps :-
> a) Start the audio rendering of webRTC stream via HTML element in safari
> browser
> b) Enable the mic capture. Disable the mic capture. Minimize the page.
> c) Open the page again. Low audio volume issue reproes.
The issue you're encountering appears to be a regression in Safari where enabling and then disabling mic permissions followed by minimizing and restoring the page results in significantly reduced audio volume for WebRTC streams. This is similar to a previously reported bug that was fixed in Safari 15.4 beta but seems to have re-emerged under specific conditions.
Steps to Reproduce:
Start audio rendering of a WebRTC stream via an HTML element in Safari.
Enable mic capture permissions.
Disable mic capture permissions.
Minimize the Safari window.
Restore the Safari window.
Observe that the audio volume is significantly reduced.
Possible Workarounds:
While waiting for a permanent fix from Apple, consider the following temporary workarounds:
Programmatic Restart of Audio Stream:
When the page is restored (using the visibilitychange event), programmatically stop and restart the audio stream. This can help reset the audio volume to the correct level.
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
const audioElement = document.getElementById('audioElement');
audioElement.pause();
audioElement.play();
}
});
User Prompt:
Prompt the user to manually toggle audio playback (pause and play) after restoring the window. This isn't ideal but can be a temporary user-driven fix.
Microphone Handling:
Avoid disabling the microphone if not necessary. If you need to toggle mic permissions, consider handling audio stream reinitialization more gracefully.
Volume Reset:
Manually reset the volume of the audio element when the page visibility changes.
document.addEventListener('visibilitychange', () => {
if (document.visibilityState === 'visible') {
const audioElement = document.getElementById('audioElement');
audioElement.volume = 0;
audioElement.volume = 1;
}
});
(In reply to asanand from comment #0)
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20240625/45c3581a/attachment-0001.htm>
More information about the webkit-unassigned
mailing list