简体   繁体   English

如何在 Admob 中静音插页式和奖励式视频广告?

[英]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?有时 Admob 会加载带有视频的插页式广告,并且默认情况下该广告的音量设置为最大,有没有办法将其静音?

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);它不能完全静音,但可以减少到 0.5% 必须在 Android 和 iOS 上通过更改全局设置手动完成MobileAds.setAppVolume(0.5);

For Android- https://developers.google.com/admob/android/global-settings对于 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);
    ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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