In General, JAVA based android app development. we may use...
setVolumeControlStream(AudioManager.STREAM_MUSIC);
So that activity makes volume controller to control MEDIA Volume.
If I want to achieve this in Adobe Air based android app.
How do I do that?
How about building an AIR native extension to interact with the system volume for Android.
Like: https://github.com/nweber/SystemVolumeNativeExtension
Related Explanation article: http://www.adobe.com/devnet/air/articles/building-ane-ios-android-pt1.html
Expected behaviour from the github readme
When changing the volume using the hardware volume keys the system
volume popup will be displayed. The AIR application will be notified
of the new volume after the system volume popup disappears. This
means that the user can press the hardware volume buttons several
times before AIR is notified of a volume change. When changing the
volume from AIR the system volume is changed, but the system volume
popup is not displayed.
Related
I want to create a TV app to control output volume. For FireOS TV to be precise.
FireTV Stick does not have any system volume control for its users. So I tried creating a normal TV application to programmatically set volume using AudioManager.setStreamVolume() but it does not works.
To my surprise there is already an App called Precise Volume Control for phones (not optimized for TV) which actually works with FireTV Stick too by sideloading. Not just that, it allows to fine control volume upto 100 levels.
How is precise volume control able to do this in FireTV Stick. Can you point me in the right direction how to achieve this?
Transport controls are probably what you are looking for. They provide access to media playback controls. Can be found here
On TV apps, usually the UI is provided by some Leanback libraries. Which can be found here
There are Leanback Transport controls here
Usually, you would also be responsible for the media that is being played if you use the transport controls.
So using openvidu to setup two way calling but I noticed an issue when it’s being used on an android device.
The android phone has multiple volume controls, one of them is the media volume, so if the user watching as a subscriber has their media volume low they can’t hear the publisher speaking until they turn it up, and a few people don’t even know this exists.
By default the volume up hardware button seems to control the phone volume, or rather it seems to control the last one that was used.
It’s a little concerning that many people won’t know about this and will complain they can’t hear anything, unlike on the iPhone where the one button controls the overall volume.
I doubt this is possible but are we able to increase the android media volume
With JavaScript somehow? I very much doubt it but I’m not sure how to solve this problem if we can’t. I know we can control the video element volume itself but that seems to have no impact on the phone volume itself. As in I can turn the phone media volume all the way up but control the video element separate instead of them working together.
I have integrated chromecast in my app.When video is running on tv i am able to change volume by clicking on chromcast icon which shows dialog box which allows to adjust volume.But i am not able to adjust the volume through my mobile device volume keys which are working fine when playing video locally.How can I program it in such a way that i am able to adjust volume through volume up down keys of mobile?
If your app is in front, then your activity can override dispatchKeyEvent() and use the Cast SDK Apis to increase or decrease the volume:
Cast.CastApi.setVolume(mApiClient, volume)
If your app is not in front, then you need to use MediaRouter with either MediaSession or RemoteControlClient to achieve that; that is more involved , you can take a look at this library to see how it does that.
Google docs states if an app isn't playing anything, hitting the volume keys adjusts the ringer volume.
see http://developer.android.com/training/managing-audio/volume-playback.html#HardwareVolumeKeys
I'm sure it is possible to change this 'default' behavior something besides STREAM_RING (say STREAM_MUSIC) by creating custom build from source, so that if the user is at, say the Launcher, and presses the volume button the the STREAM_MUSIC volume will change.
(This require is because the device doesn't have a phone so ring volume is a no-op).
I've looked at the Launcher code but it doesn't show (at least not that I can see) that volume buttons are directed/consumed via AudioManager to STREAM_RING.
Also when in 'Settings' the VOLUME buttons change STREAM_RING, which leads me to further believe there is something 'Up the chain' or 'Down the stack in Application Frameworks or in the Android Runtime'.
Is there a 'higher' Activity or system process running that handles the dispatch of VOLUME to the AudioManager with the STREAM_RING as the channel?
Or is there something within AudioManager that could be set so that it processes VOLUME changes to the STREAM_MUSIC (this seems unlikely from the source as it appears to only process the STREAM in the context of an applications preferred STREAM.
The source I'm using is Ice Cream Sandwich 4.0.3.
The solution appears to be setting "config_voice_capable" to false.
This value is found in frameworks/base/core/res/res/values/config.xml
I used an overlay to set the "config_voice_capable" to false, then built the rom.
After the device boots the volume controls no longer default to the RINGER stream.
I was not able to find documentation on this regarding differences between
tables and phone capable devices, but the solution works.
I want to lower the ringtone, media volume, and alarm volume from an app (button press, no slider). So I've been reading up on AudioManager , but I'm still a bit confused on how to do this.
Also, with Audio Manager, is the volume set for the whole phone or just for the app? I want it to be for the whole phone
but I'm still a bit confused on how to do this
Call adjustStreamVolume() with your desired stream (e.g., STREAM_ALARM) and change (e.g., -1). Here is a sample project that demonstrates this.
is the volume set for the whole phone or just for the app?
Android does not have a concept of app-specific volume, so this is for the whole phone.