Specify bitrate and media format
Stay organized with collections
Save and categorize content based on your preferences.
VAST responses can contain multiple media files with different
bitrates and in different formats. The SDK chooses the appropriate bitrate
based on the current network conditions:
- max 500 kbit/s for cellular connection
- unlimited for WiFi
If you want to specify preferred video formats and bitrate, use an
AdsRenderingSettings
instance to pass this information at the time of Ads Manager initialization.
@Override
public void onAdsManagerLoaded(AdsManagerLoadedEvent adsManagerLoadedEvent) {
...
AdsRenderingSettings adsRenderingSettings =
ImaSdkFactory.getInstance().createAdsRenderingSettings();
List mimeTypes = new ArrayList();
mimeTypes.add("video/mp4");
mimeTypes.add("video/webm");
adsRenderingSettings.setBitrateKbps(1024);
adsRenderingSettings.setMimeTypes(mimeTypes);
mAdsManager.init(adsRenderingSettings);
}
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[[["\u003cp\u003eVAST responses may include multiple media files with varying bitrates and formats, and the SDK automatically selects the optimal bitrate based on network conditions (500 kbit/s maximum for cellular and unlimited for WiFi).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can customize preferred video formats and bitrates by utilizing \u003ccode\u003eAdsRenderingSettings\u003c/code\u003e during Ads Manager initialization to exert more control over ad playback.\u003c/p\u003e\n"]]],[],null,["# Specify bitrate and media format\n\nVAST responses can contain multiple media files with different\nbitrates and in different formats. The SDK chooses the appropriate bitrate\nbased on the current network conditions:\n\n- max 500 kbit/s for cellular connection\n- unlimited for WiFi\n\nIf you want to specify preferred video formats and bitrate, use an\n[AdsRenderingSettings](/interactive-media-ads/docs/sdks/android/client-side/api/reference/com/google/ads/interactivemedia/v3/api/AdsRenderingSettings)\ninstance to pass this information at the time of Ads Manager initialization. \n\n```transact-sql\n@Override\n public void onAdsManagerLoaded(AdsManagerLoadedEvent adsManagerLoadedEvent) {\n ...\n AdsRenderingSettings adsRenderingSettings =\n ImaSdkFactory.getInstance().createAdsRenderingSettings();\n List mimeTypes = new ArrayList();\n mimeTypes.add(\"video/mp4\");\n mimeTypes.add(\"video/webm\");\n adsRenderingSettings.setBitrateKbps(1024);\n adsRenderingSettings.setMimeTypes(mimeTypes);\n mAdsManager.init(adsRenderingSettings);\n }\n```"]]