videojs + ima, how to set currentTime?

549 views
Skip to first unread message

Damjan Oslaj

unread,
Sep 4, 2020, 6:48:22 AM9/4/20
to Interactive Media Ads SDK
Hi,

how can I set currentTime throught ima sdk? I just want to pause the player at last second, show replay button and on click replay the video without triggering adImpression again (I just want to play the video again on replayButton click).

At the moment I get the currentTime with:
player.ima.addEventListener(EventType.AD_PROGRESS, (IMAEvent) => {
         // @ts-ignore
         let adProgressData= IMAEvent.getAdData();
         console.log(parseInt(adProgressData.duration)-parseInt(adProgressData.currentTime)); 
 });

But I didnt not yet find a way how to set it to 0.

setting the html5 videoElement.currentTime = 0, does not work on android chrome so I need some other solution.

Thanks a lot.

Damjan


IMA SDK

unread,
Sep 4, 2020, 11:33:51 AM9/4/20
to damj...@vlyby.com, ima...@googlegroups.com
Hi Damjan,

Currently the SDK doesn't expose an API to set the ad to the beginning. You currently have an option to serve VPAID or SIMID ads that will give more flexibility.

For support for the IMA videoJS plugin you can use the VideoJS-IMA Github Issue Tracker.

I will bring up your request with the rest of my team. We will review your request. You may monitor our blog for updates.

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q24Yz0S:ref

Damjan Oslaj

unread,
Sep 6, 2020, 10:53:41 AM9/6/20
to Interactive Media Ads SDK
Looks like you are setting correct SRC property on html5 video element on ios CHROME but not on Android Chrome

IMA SDK

unread,
Sep 7, 2020, 12:04:14 AM9/7/20
to damj...@vlyby.com, ima...@googlegroups.com

Hi Damian,

Thanks for your response. Could you please elaborate on the issue with regard to the incorrect SRC property of HTML5 video element on Android Chrome? It would be great if you could give more details so we could check further.

Regards,

Google Logo
Sherwin Diesta
IMA SDK Team
 


ref:_00D1U1174p._5004Q24Yz0S:ref

Damjan Oslaj

unread,
Sep 7, 2020, 1:44:31 AM9/7/20
to Interactive Media Ads SDK
For example if you go to this site (https://googleads.github.io/videojs-ima/examples/advanced/) with example videojs+ima and paste in the test AD TAG and play the video. 
On iOs >Chrome you will see src property from the html5 video getting replaced with the src from the ad and on android Chrome the src property from the html video tag stays //commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

IMA SDK

unread,
Sep 7, 2020, 3:14:03 AM9/7/20
to damj...@vlyby.com, ima...@googlegroups.com

Hi Damjan,

Thanks for getting back to us and for sharing additional information regarding your concern. I was able to replicate this behavior using our advanced sample app for HTML5. I’m going to share this with the team to check further and will let you know once we have an update.

Regards,

IMA SDK

unread,
Sep 9, 2020, 2:42:12 AM9/9/20
to damj...@vlyby.com, ima...@googlegroups.com

Hi Damjan,

Just an update. I received feedback from the team about the src attribute being added inside the video element when on iOS but not with Android. The team confirmed that the IMA SDK doesn’t cause this behavior but it seems to be how the Chrome browser handles the different environments. Do you have any specific issues related to this behavior?

Regards,

Damjan Oslaj

unread,
Sep 9, 2020, 4:13:22 AM9/9/20
to Interactive Media Ads SDK
Hi,

I was trying to make replay button that just replays video from the ad and does not trigger ad impression 1 more time. I made it work by mocking userAgent getter(by adding iPhone at the end of the string) and so far everything works fine. My only concern would be if this could effect view through rate(VTR) tracking on android chrome(inside VPAID on the SSP side) ?

IMA SDK

unread,
Sep 9, 2020, 5:37:40 AM9/9/20
to damj...@vlyby.com, ima...@googlegroups.com

Hi Damjen,

Thanks for your response. Just wanted to clarify your concern on view through rate (VTR) tracking. Is this about your implementation of replaying the video from the ad without triggering an ad impression? Or is it about the src attribute not being added inside the video element on Android Chrome?

If this is regarding the former, then I’m afraid we can’t tell if this may affect the VTR since this is a custom implementation. I would suggest reaching out to your ad account manager to check the numbers of completed views of ads over the number of impressions.

However, if this is regarding the latter, then this shouldn’t have an effect on the VTR for Android Chrome considering that this is the common behavior (as per testing by the team) as compared with the iOS where it does update the video tags src. As a side note (for iOS Chrome). If you added playsinline to the video element, this will stop updating the video tag's src attribute.

Please let me know if you have further questions or clarifications.

Regards,

Reply all
Reply to author
Forward
0 new messages