I am using Google-IMA Android SDK
for loading adds and playing videos in my application.
From the sample app provided in this link , I am able to play advertisements and videos.
But I am not able to mute audio for advertisements played.
Tried with setAdWillPlayMuted(boolean) as per the Android API reference, but still adds play with audio.
But in IMA SDK for IOS
, IMAAdsManager volume API can be used to mute volume for add , which is working in IOS devices as expected.
I am using interactivemedia:3.9.0
as per the downloaded sample version in Android.
Do I need to use any other API's or Classes to achieve muting Advertisement volume?
NOTE: Muting the system volume is not something I am trying to achieve
The only way I was able to toggle the volume of an IMA Advertisement on Android was to use ExoPlayer to load the IMA advertisement.
The ExoPlayer library has APIs that allow for providing an Ad Tag via the AdsMediaSource class.
After successfully loading ads via ExoPlayer, I was able to use the ExoPlayer's volume control APIs to mute/unmute the advertisement.
Granted it's not the most ideal solution and I'm sorry I don't have better advice.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With