Stay organized with collections
Save and categorize content based on your preferences.
The MobileAds class provides global settings for the Mobile Ads SDK.
Video ad volume control
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 enables 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.
You can report the relative app volume to the Google Mobile Ads SDK by calling
the SetApplicationVolume() method. Valid ad volume values range from 0.0
(silent) to 1.0 (current device volume). Here's an example of how to report
the relative app volume to the SDK:
// Set app volume to be half of current device volume.MobileAds.SetApplicationVolume(0.5f);
To inform the SDK that the app volume has been muted, use the
SetApplicationMuted() method:
// Set app to be muted.MobileAds.SetApplicationMuted(true);
By default, the app volume is set to 1 (the current device volume), and the
app is not muted.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-07-12 UTC."],[[["The `MobileAds` class allows you to manage global settings for the Mobile Ads SDK, including video ad volume."],["You can control the volume of video ads relative to your app's volume using `SetApplicationVolume()` for a better user experience."],["Muting or lowering app volume can impact video ad eligibility and potentially reduce ad revenue, so use volume controls judiciously and only when reflecting actual user preferences."]]],[]]