Specifying bitrate and video format
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.
function onAdsManagerLoaded(adsManagerLoadedEvent) {
const adsRenderingSettings = new google.ima.AdsRenderingSettings();
adsRenderingSettings.bitrate = 1024; //kbits
adsRenderingSettings.mimeTypes = [ 'video/mp4', 'video/webm’ ];
adsManager = adsManagerLoadedEvent.getAdsManager(
videoContent, 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-03-06 UTC.
[null,null,["Last updated 2025-03-06 UTC."],[[["VAST responses may include multiple media files with varying bitrates and formats, with the SDK automatically selecting the optimal bitrate based on network conditions (500 kbit/s maximum for cellular and unlimited for WiFi)."],["Developers can customize preferred video formats and bitrates by utilizing an `AdsRenderingSettings` instance during Ads Manager initialization to specify desired settings like bitrate and MIME types."]]],[]]