Admob plugin - can setAppVolume and setAppMuted be implemented?

Our client is having complaints about “noisy ads” and would like the option to silence them. With Vungle we have the option to pass in “isSoundEnabled=false” when we show an ad, but we don’t have the option to do so with Admob.

However I’ve found that Admob has functions for muting the ads, as described here:

https://developers.google.com/admob/android/global-settings

Perhaps these functions are already in the plugin, but are just not documented. 

Is it possible to have these features included in the plugin? 

I’m investigating.

Rob

For now we don’t provide Corona users that ability, but I’ll see what I can do.

I’ll try to put it on our schedule as soon as possible, should be included in the next plugin update in about 1-2 week. B)

Btw,

Note:  Video ads that are ineligible to be shown with muted audio are not returned for ad requests made when the app volume is reported as muted or set to a value of 0. This may restrict a subset of the broader video ads pool from serving.

Thanks karpovpw - I’ve made our client aware that the fill could be lower. 

If the volume is lowered rather than muted (e.g. set to 0.5) would that affect the fill? Just trying to work out if there is a good middle ground between reducing the audio and maintaining the fill.

Hi Alan,
 

Well, I’m not working at google, so can’t say for sure, but if doc page doesn’t specify that, I think that any value, besides 0.0 should result in normal fill.

Since muting is absolutely the same thing as setting volume at 0.0 level, we’ll include only volume parameter to avoid cluttering api.

The update should be public till the end of this week.

Hi Alan,

We’ve just updated AdMob plugin with the latest Google’s sdk and added a new init parameter -  videoAdVolume.

You can get more info at https://docs.coronalabs.com/plugin/admob/init.html

Hi karpovpw,

Many thanks for this.

I’m generally a fan of Corona’s approach of simplifying code in this way. i.e. one function to control volume that can also mute with the 0.0 setting. However, in this case I think it would be useful to update the docs to explain the warning you mentioned above:

Note: Video ads that are ineligible to be shown with muted audio are not returned for ad requests made when the app volume is reported as muted or set to a value of 0. This may restrict a subset of the broader video ads pool from serving.

Cheers,

Ian

Yeah, that’s a good point, docs will be updated soon.  :wink:

edit: done!

Does this need to be built using a particular version of Corona? I’ve just tried using build 2017.3184 and even though I set:

videoAdVolume=0.1

the audio was still at the same volume as usual.

Edit: If it’s any help, the plugin version is printing out as

 plugin.admob: 1.2.2 (SDK: 11400000)

Anything after 3049 is acceptable. Your plugin version 1.2.2 is the newest one.

We’ve already tested this new release and everything working as expected. It’s an important part of the release.

I’ve tested it for myself right now just to be sure and I have no issue changing volume both on android and ios devices, tried values 0.0 0.1 0.5 1.0 for both.

Could you try 0.0, to see if it works for you at all? We’ll start from there. Also, what is your test device? Can you show your init() code?

Here is my init code:

admobPlugin.init( adListener, { appId=key, testMode=false, videoAdVolume=0.0 } )

Also tried with videoAdVolume = 0.1, in both cases the audio is full volume. 

We have tested on a Samsung Galaxy S7 and S8 (both running Android 7.0)

So, with mentioned _videoAdVolume=0.0 _the audio isn’t muted?

Then it’s definitely not app-plugin issue, but more plugin-sdk-system issue. Can you make sure that there is nothing stopping admob from muting your app? Like something about:

If your app has its own volume controls (such as custom music or sound effect volumes), disclosing app volume to the Google Mobile Ads SDK allows video ads to respect app volume settings. This ensures users receive video ads with the expected audio volume.

The device volume, controlled through volume buttons or OS-level volume slider, determines the volume for device audio output. However, apps can independently adjust volume levels relative to the device volume to tailor the audio experience.

mentioned in https://developers.google.com/admob/android/global-settings

Since we cannot reproduce this issue on our test devices for now, can you make some kind of a sample project for us to catch a bug? It shouldn’t be your main project or something.

You can fill a form here: https://portal.coronalabs.com/bug-submission 

Make sure to include this mentioned sample.

Hi Alan,

Is the problem still persist for you or was it solved already?

Hello,

thanks for integrating this feature of AdMob!

But why can I only set the parameter in the init-method? Wouldn’t it make more sense to have a “setVolume” method like in the native SDK? Because e.g. in my game when the user toggles the Mute button, I want to toggle the volume as well, and it should take effect before the next start of the app.

Best regards!

Hi,

That’s a valid point. The requested method will be added in the next plugin update. 

Hi, any news on this topic?

Best regards!

Hi bjoern,

Next plugin update planned to the next week, so that should be an ETA for a separate method too.

I’m investigating.

Rob