Stay organized with collections
Save and categorize content based on your preferences.
This guide walks you through adding a countdown timer to an HTML5 IMA SDK implementation.
Prerequisites
This guide assumes that you have a working HTML5 IMA SDK implementation. If you don't,
refer to the Get Started guide.
Create the timer
Adding a countdown timer to your IMA-enabled video player only requires
adding a few lines of JavaScript to poll the remainingTime property
of the AdsManager instance. We use the setInterval() method to
call a function every second to check adsManager.remainingTime.
[[["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-02-20 UTC."],[[["This guide explains how to add a countdown timer to an HTML5 IMA SDK implementation for video ads."],["The recommended approach is to use the built-in HTML5 IMA SDK countdown timer; however, this guide provides custom implementation steps if needed."],["The custom implementation involves polling the `remainingTime` property of the `AdsManager` and updating the UI accordingly."],["A working implementation example is provided via a CodePen link for reference and testing."]]],[]]