简体   繁体   中英

How to mute Interstitial and Rewarded video ads in Admob?

Code:

void _ads() async {
  var interAd = InterstitialAd(
    adUnitId: "use_some_genuine_ad_id_not_test_one",
  );

  await interAd.load();
  await interAd.show();
}

Problem:

Sometimes Admob loads an Interstitial ad with with video and the volume by default to that ad is set to maximum, is there any way to mute it?

And also for Rewarded video ads, I can't find any option to mute the ads, can anyone help?

It cannot be muted completely, but reduced to 0.5% It has to be done manually on Android and iOS by changing global settings MobileAds.setAppVolume(0.5);

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

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_my);
    
    MobileAds.initialize(this, new OnInitializationCompleteListener() {
        @Override
        public void onInitializationComplete(InitializationStatus initializationStatus) {}
    });
    
    // 0.5 is the least you can reduce
    MobileAds.setAppVolume(0.5);
    ...
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM