Android TV/FireOS TV volume control - android

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.

Related

Is WindowManager.LayoutParams.preferredDisplayModeId a global, permanent setting?

My android tv box doen't make my tv change its frame rate when playing videos, but it allows me to manually change my frame rate through a system setting called HDMI output, however it requires many clicks to get there. I would like to develop an app that mimics the HDMI output system setting.
I saw that WindowManager.LayoutParams.preferredDisplayModeId is supported since android 6.0 while my tv box has android 10.
I have some doubts that this will work because all video players could have used it, but none of them does it, my tv stays at 60hz, while all my videos use 24hz.
If I successfully change my frame rate with WindowManager.LayoutParams.preferredDisplayModeId, will this stay even if my app is terminated? Is this a global setting, just like the HDMI output setting, or is it an app-specific setting?

Openvidu subscriber volume on android

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.

How to listen for HDMI-CEC media controls events in receiver

Google recently announced that Chromecast now supports HDMI-CEC controls.
https://plus.google.com/+LeonNicholls/posts/FyGeJavgmX3
I would like the implement the functionality in my app. I have tested with Youtube and my TV and it works. How can I implement the same thing in the receiver portion of my Chromecast app? I have tried listening for key events, but that doesn't seem to pick anything up. Any ideas?
As long as you use the Media Manager on the receiver side (the recommended approach), you shouldn't need to do anything special.
As stated in your article, it's basically only the Google Cast media namespace namespace that supports HDMI-CEC, so basically for custom receiver apps, the answer is no. For media namespace apps, just implement the API and it should work automatically.
I know the media HDMI-CEC support includes turning on the TV, switching to the ChromeCast input, pause and play. It's possible it also includes volume (including mute) and seeking as these are also media playback messages defined in that API.
It might be cool if you could use those buttons to control a custom receiver running on the CC but I suspect that the only way to do that is to generate a video in the sender and stream that to the CC, generating new video based on remote control interaction. I.e. An expensive and rather indirect way.
On the other hand - as a proof of concept maybe that would encourage google to open the HDMI-CEC API to non-media apps.

Adjusting chromecast tv volume through mobile device volume up down buttons

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.

How to Set Media Volume Control for Android Adobe AIR?

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.

Categories

Resources