Ensuring Consistent Speakerphone Volume Control for Published Video Playback

hyuk

Member
I am conducting tests on the demo site with two-way streaming and have encountered an issue related to audio playback and volume control on Android devices.

When adjusting the android ( galaxy flip 4 chrome web browser ) hardware volume buttons during a WebRTC connection, the volume always controls the speakerphone. However, the published video playback switches inconsistently between the speakerphone audio and media audio, making it challenging to manage consistent audio output.

Specifically, last evening, the video playback briefly used the speakerphone audio, allowing the speakerphone volume to be adjusted. However, today, the video playback is using the media audio.

I would like to ensure that the published video playback consistently uses the speakerphone audio. Is there a way to configure this behavior?

Thank you for your assistance.

※ For reference, our previous project built with Flashphoner has consistently operated with the speakerphone volume. We compared the inconsistent behavior of the new project with the code from the previous one but found it difficult to identify any differences.
 
Last edited:

Max

Administrator
Staff member
Good day.
You can select an audio output device as described here: Sound device selection. See also Media Devices example: documentation, demo. If the output device is available for browser, it will appear in the list. So you can select speakerphone, then hardware volume buttons should work.
 

hyuk

Member
I have already tried that feature, but only one default sound device appears. I tested it using on the "Media Devices" demo site by connecting the WebSocket server to our own server (the Flashphoner WebSocket site returned a fail).

During the tests, I noticed something unusual: when I entered our Flashphoner WebSocket server on the "Two-way Streaming" demo site, the playback used the speakerphone volume. However, when using the Flashphoner demo site's WebSocket server, the playback switched to the media volume.

For reference, on Samsung browsers, the playback consistently uses the speakerphone volume. However, on Chrome browsers, the behavior is inconsistent.
 
Last edited:

Max

Administrator
Staff member
I have already tried that feature, but only one default sound device appears. I tested it using on the "Media Devices" demo site by connecting the WebSocket server to our own server (the Flashphoner WebSocket site returned a fail).
The default device is speakerphone. So if you set it explicitly, the speakerphone will be used. In Two Way Streaming the output device even does not checked, the example uses the device provided by browser.
Please also clarify the Android version and the browsers versions. We can't even reproduce the issue on Samsung S10+ (Android 12) and Google Pixel 3 (Android 12) in Chrome 131.0.6778.81.
 

hyuk

Member
Samsung Galaxy flip 4 (Android 14) in Chrome 131.0.6778.81 / Samsung Galaxy 23 (Android 14) in Chrome 131.0.6778.81 / Samsung Galaxy S20+ (Android 13) in Chrome 129.0.6668.82

This was confirmed on the Flashphoner demo site (Two-Way Streaming)

All three devices showed only one default option when checking the "Play audio output" under "Media Devices" on the demo site.

Just a moment ago, the playback was briefly using the speakerphone volume on a specific phone (Samsung Galaxy flip 4). However, since then, it has switched back to the media volume.
 
Last edited:

Max

Administrator
Staff member
All three devices showed only one default option when checking the "Play audio output" under "Media Devices" on the demo site.
What output device is used when you choose "Default" for "Play audio output"? Do the hardware buttons work for this output device?
 

hyuk

Member
It only displays as "default" without providing any additional information, so it's impossible to know what it represents.
Even after checking the logs, no additional information could be obtained.

※ After testing three times on an older device, it worked correctly. For your reference: LG G7+ Android 10, Chrome 131.0.6778.81.


KakaoTalk_20241204_153810642.jpg
 
Last edited:

Max

Administrator
Staff member
It only displays as "default" without providing any additional information, so it's impossible to know what it represents.
Usually, voice speaker and external speaker are on different phone edges (top and bottom respectively). Please check from what speaker do you hear the sound. Also please check if the hardware buttons change the volume.
 

hyuk

Member
It is difficult to determine where the sound is coming from, as it plays across the entire device, making it hard to pinpoint its source. However, as mentioned previously, in most cases, the hardware volume keys do not adjust the volume. Instead, the media volume needs to be adjusted. Occasionally, about once in ten attempts, the hardware volume keys work, but I am not sure why this happens.

The reason I am raising this issue is that the hardware volume keys fail to adjust the volume.

For example, when the volume is set like this, the sound is not loud but rather quiet.

KakaoTalk_20241204_161441622.jpg
 
Last edited:

Max

Administrator
Staff member
We reproduced the behavior in Chrome 131 on Samsung S10+ when publishing and playing a stream on the same page. Neither hardware buttons nor sliders do not change teh playback volume in this case. This seems like Chrome issue on Samsung devices (it is not reproducing on Google Pixel 3 in the same Chrome version), and we can't do anything with it using browser API. So we recommend to use other browser on Samsung device, Samsung Internet for example.
 
Top