videoSlot.currentTime not updating in VPAID JS creative?

265 views
Skip to first unread message

Michael Adams

unread,
Sep 3, 2017, 8:47:27 PM9/3/17
to Interactive Media Ads SDK
Hi there,

I am debugging an issue with the IMA HTML5 SDK and Javascript VPAID creatives.

According to https://developers.google.com/interactive-media-ads/docs/sdks/html5/vpaid2js#proxyelement the VPAID JS will be provided with a proxy element representing the video being played. However in my code I have added an event listener to "timeupdate" but this never gets triggered. Polling and checking the value of the video slot's currentTime also never changes from "0".

Steps to recreate the issue:
3. Start playing the video
4. Check console:


As you can see, the currentTime value never changes from 0, despite the whole video playing.

Relevant portion of JS:
    this.videoSlot.addEventListener('timeupdate', function() {
     
return console.log('timeupdate', arguments);
   
});
   
this.videoSlot.addEventListener('play', function() {
     
return console.log('play', arguments);
   
});
   
this.videoSlot.addEventListener('pause', function() {
     
return console.log('pause', arguments);
   
});
    setInterval
(((function(_this) {
     
return function() {
       
return console.log('currentTime', _this.videoSlot.currentTime);
     
};
   
})(this)), 1000);

Any insight into why the proxyelement isn't notifying the advert about playback?

Thanks,
Michael Adams.

Joshua Lagonera (IMA SDK Team)

unread,
Sep 4, 2017, 2:33:45 AM9/4/17
to Interactive Media Ads SDK
Hi Michael,

I believe the 'currentTime' property is only available for ads with Video Content since the Event Listeners apply to the ad, and not the underlying video content. Looking at your Ad Tag, it doesn't seem to contain any kind of video asset and only contains a 'Testing Advert' text which may explain why 'currentTime' is not being updated. Can you try adding a video element and check if you can still see the same behavior?

Regards,
Joshua Lagonera
IMA SDK Team

Michael Adams

unread,
Sep 7, 2017, 10:47:16 PM9/7/17
to Interactive Media Ads SDK
Hi Joshua,

I've tried setting the this.videoSlot.src to a video file and running .play() on it, which does indeed cause a video to start playing and .currentTime to update. However that isn't really what I'm after, and is a bit weird as you end up with two videos playing at once!

What I'm to do is create an interactive non-linear creative that responds to the underlying video, i.e. the content of the creative changes depending on the playback of the video. The VPAID support in JwPlayer allows access to this property, however we can't recreate this using the IMA SDK. Is there any way for a VPAID JS creative to get access to this property?

Thanks,
Michael Adams.

Chris Feldman (IMA SDK Team)

unread,
Sep 8, 2017, 3:01:57 PM9/8/17
to Interactive Media Ads SDK
Hi Michael,

Have you tried using the INSECURE VPAID mode? This should give your VPAID ad access to the actual video element and therefore any information that you need about the content video.

Regards,
Chris Feldman
IMA SDK Team

Michael Adams

unread,
Sep 10, 2017, 8:33:46 PM9/10/17
to Interactive Media Ads SDK
Hi Chris,

I've just done a test in INSECURE mode and while this gives me access to a video element, it isn't the video element of the video being played, rather an empty video tag waiting for some content.

Here is a screenshot of the DOM inspector. (1) is the video element that is playing, while (2) is the video element that is parsed in through the videoSlot call.

Is there any way to get access to the events of (1) in the VPAID creative?

Thanks,
Michael Adams.

Yury Pavlotsky (IMA SDK Team)

unread,
Sep 11, 2017, 1:37:15 PM9/11/17
to Interactive Media Ads SDK
Hi Michael,

I think it's likely there's some issue with your VPAID ad implementation that's causing the issue. We have an example VPAID ad that you can use to test your setup: https://github.com/googleads/googleads-ima-html5/blob/master/vpaid/VpaidVideoAd.js. One thing I would recommend to simplify testing is in line 190 where VpaidVideoAd.js is looking for videos passed in as ad parameters, you can just provide an MP4 URL directly.

Thanks,
Yury Pavlotsky
IMA SDK Team
Reply all
Reply to author
Forward
0 new messages