Stay organized with collections
Save and categorize content based on your preferences.
The IMA SDK supports preloading video ad assets.
You can enable this feature in your SDK integration
to provide a more seamless transition between ads and content.
This guide goes over the technical details of implementing
media preload with the IMA SDK.
The following table summarizes the changes in ad-load timing when preloading
is enabled:
Event
With Preload
Without Preload
Ad VAST requested
AdsLoader.requestAds()
AdsLoader.requestAds()
Pre-roll loaded (single ad)
AdsManager.init()
AdsManager.start()
Pre-roll loaded (VMAP/Ad rules)
AdsManager.init()
AdsManager.init()
Mid-roll or post-roll loaded
For the 1st ad in an ad break, 8 seconds before ad start time.
For consecutive ads, when the previous ad starts playing.
At ad start time.
Limitations
Preloading is subject to the following limitations:
Media preloading is not available on the mobile web on iOS devices or when
using the HTML5 IMA SDK on connected smart TVs.
VPAID is preloaded, but none of the ad's dependencies—including
media played by that ad—are loaded until the ad is executed.
Autoplay must be enabled to preload VMAP ads. Ensure that
settings.isAutoPlayAdBreaks() is set to true, which is the default value.
Post-rolls are preloaded following the last mid-roll, or 8 seconds before
the end of content if
AdsRequest.contentDuration
is used to set the duration.
FAQ
Does media preloading load the full creative?
No, the creative is usually not fully loaded when ad playback begins.
Preloading is intended for improving the user experience by minimizing the time
it takes for the ad to load. It is not intended to support offline ad serving.
The IMA SDK loads as much of the media as the browser allows, limited by the
user's internet connection and the size of the creative.
Does media preloading need to be enabled for the ad's VAST as well as media?
No, the SDK always preloads the ad's VAST, regardless of this preload
setting.
[[["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 2025-08-28 UTC."],[[["\u003cp\u003eThe IMA SDK supports preloading to enable seamless transitions between ads and content.\u003c/p\u003e\n"],["\u003cp\u003ePreloading is enabled by setting \u003ccode\u003eAdsRenderingSettings.enablePreloading\u003c/code\u003e to \u003ccode\u003etrue\u003c/code\u003e when the \u003ccode\u003eADS_MANAGER_LOADED\u003c/code\u003e event fires.\u003c/p\u003e\n"],["\u003cp\u003ePreloading timing varies depending on ad type (pre-roll, mid-roll, post-roll) and ad scheduling (single ad, VMAP, ad rules).\u003c/p\u003e\n"],["\u003cp\u003ePreloading has limitations on certain platforms like iOS and smart TVs, and for VPAID ads and post-rolls with unknown content duration.\u003c/p\u003e\n"],["\u003cp\u003eMedia preloading aims to minimize ad load time, it does not fully download the entire creative or support offline ad serving.\u003c/p\u003e\n"]]],[],null,["# Preload media\n\nThe IMA SDK supports preloading video ad assets.\nYou can enable this feature in your SDK integration\nto provide a more seamless transition between ads and content.\nThis guide goes over the technical details of implementing\nmedia preload with the IMA SDK.\n\nEnable preloading\n-----------------\n\nTo enable preloading, set [`AdsRenderingSettings.enablePreloading`](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRenderingSettings#enablePreloading) to true. This must be done as a result of the `ADS_MANAGER_LOADED` event:\n\n\u003cbr /\u003e\n\n function onAdsManagerLoaded(adsManagerLoadedEvent) {\n var adsRenderingSettings = new google.ima.AdsRenderingSettings();\n adsRenderingSettings.enablePreloading = true;\n ...\n var adsManager = adsManagerLoadedEvent.getAdsManager(\n videoContent, adsRenderingSettings);\n }\n\nTiming\n------\n\nThe following table summarizes the changes in ad-load timing when preloading\nis enabled:\n\n| Event | With Preload | Without Preload |\n|---------------------------------|--------------------------------------------------------------------------------------------------------------------------|--------------------------|\n| Ad VAST requested | `AdsLoader.requestAds()` | `AdsLoader.requestAds()` |\n| Pre-roll loaded (single ad) | `AdsManager.init()` | `AdsManager.start()` |\n| Pre-roll loaded (VMAP/Ad rules) | `AdsManager.init()` | `AdsManager.init()` |\n| Mid-roll or post-roll loaded | For the 1st ad in an ad break, 8 seconds before ad start time. For consecutive ads, when the previous ad starts playing. | At ad start time. |\n\nLimitations\n-----------\n\nPreloading is subject to the following limitations:\n\n- Media preloading is not available on the mobile web on iOS devices or when using the HTML5 IMA SDK on connected smart TVs.\n- VPAID is preloaded, but none of the ad's dependencies---including media played by that ad---are loaded until the ad is executed.\n- Autoplay must be enabled to preload VMAP ads. Ensure that `settings.isAutoPlayAdBreaks()` is set to `true`, which is the default value.\n- Post-rolls are preloaded following the last mid-roll, or 8 seconds before the end of content if [`AdsRequest.contentDuration`](/interactive-media-ads/docs/sdks/html5/client-side/reference/js/google.ima.AdsRequest#contentDuration) is used to set the duration.\n\n| **Note:** Setting `contentDuration` to the reserved value `-3` (with `contentDuration(-3)`) is a special value that identifies an unknown content duration and disables preloading for VAMP post-rolls.\n\nFAQ\n---\n\nDoes media preloading load the full creative?\n: No, the creative is usually not fully loaded when ad playback begins.\n Preloading is intended for improving the user experience by minimizing the time\n it takes for the ad to load. It is not intended to support offline ad serving.\n\n The IMA SDK loads as much of the media as the browser allows, limited by the\n user's internet connection and the size of the creative.\n\nDoes media preloading need to be enabled for the ad's VAST as well as media?\n: No, the SDK always preloads the ad's VAST, regardless of this preload\n setting."]]