Show loading indicator while loading/requesting ads

349 views
Skip to first unread message

jus...@streamable.com

unread,
Apr 29, 2016, 2:41:26 PM4/29/16
to Interactive Media Ads SDK
Hey all,

I'm using the HTML5 IMA SDK by way of the Video.js plugin (https://github.com/googleads/videojs-ima) to run pre-roll ads. When the user starts the video, a black overlay covers the video player while the ads are requested/loaded with no sort of progress indicator. This can last many seconds before the ad player comes to life. Sometimes a load spinner does appear, but that only happens after the ad controls show, which can be many seconds after the user starts playing the video. Is there any way to show a progress indicator sooner in the process?

Thanks!

Vu Chau (IMA SDK Team)

unread,
Apr 29, 2016, 3:24:09 PM4/29/16
to Interactive Media Ads SDK
Hey Justin,

Thanks for bringing that up! To me this sounds like something you can do by customizing the video player itself.  One way I would do it is to create a custom div matching the dimensions of the video player.  This div contains a loading spinner, and will overlay the video player.  Display this div as soon as you detect the Play button has been clicked.  Once the ad is ready to play (either via LOADED or STARTED [for the difference - see API]), you can remove this div.

The SDK doesn't have a sense of progress during the ad request stage (as it would with the ad playback, since the VAST XML provides the ad's duration), so showing a progress bar at this time is not efficient.  Popping the div I suggested after the click action and prior to LOADED/STARTED should be good enough to cover the ad request stage.

Vu Chau
IMA SDK Team
Reply all
Reply to author
Forward
0 new messages