HTML5 plugin fails to resolve/reject play-promise when in secure mode

295 views
Skip to first unread message

Leandro Silva

unread,
Mar 20, 2018, 10:04:36 AM3/20/18
to Interactive Media Ads SDK
Hello Google IMA team,

We're experiencing an issue with your HTML5 IMA plugin when in secure mode and are hoping you can provide guidance.

When trying to run an ad in a player that uses your plugin in secure mode -- which returns a proxy object instead of an HTML element -- the videoSlots play-promise never completes. Upon starting an ad, we check the play method and indeed see that it's of type Promise, but find that it never resolves nor rejects. The Promise forever stays in its pending state.

Note that in cases where IMA is nonexistent, and more interestingly, in cases where IMA is in insecure mode (where an HTML video element is returned), our logic works as expected.

Per your online docs, we're listening to the Promise in the expected way. Here’s some sample code:

<js>
  let playPromise = this._videoSlot.play();

  console
.log(playPromise); // Promise {<pending>}

 
if (playPromise !== undefined) {
   
// The above condition is met, but the Promise never
   
// resolves nor rejects (and stays in a pending state)
    playPromise
     
.then(() => /* Autoplay will work, start ad accordingly */)
     
.catch(() => /* Autoplay will fail, start ad accordingly */)
 
} else {
   
// Start ad accordingly
 
}
</js>

We're testing the ad via Chrome in your Video Suite Inspector.

Steps to reproduce:

3. Test ad
4. The ad will not play (since the expected Promise is never resolved/rejected)

***

To make matters a bit more confusing, the above tag will work on your page if a working tag is played first. 

Steps to reproduce:

2. Click the "sample" VAST link to load your included sample tag
3. Test ad
4. At any point after, without reloading the page, paste in the "failing" VAST tag https://static.tremorvideodsp.com/QA/leandro_ad_3.xml
5. Test ad
6. The ad will play as expected



Regards,

Leandro Silva
Lead Solutions Architect
Tremor Video DSP

ima-sdk-adv...@google.com

unread,
Mar 20, 2018, 3:00:18 PM3/20/18
to ima...@googlegroups.com
Hi Leandro,

Thank you for reaching out to support. You should not need to check the play-promise from your VPAID ad. The SDK docs recommend that this promise be checked by the player. By the time the VPAID ad is started, the player should have already determined whether or not autoplay is allowed. For example, our attempt_to_autoplay sample will only attempt to start an ad under conditions that it knows will not cause an error. The ad should not need to repeat this check.

Regards,
Chris Feldman
IMA SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

--
You received this message because you are subscribed to the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ima-sdk+unsubscribe@googlegroups.com.
To post to this group, send email to ima...@googlegroups.com.
Visit this group at https://groups.google.com/group/ima-sdk.
For more options, visit https://groups.google.com/d/optout.
Message has been deleted
Message has been deleted

Leandro Silva

unread,
Mar 20, 2018, 5:37:18 PM3/20/18
to Interactive Media Ads SDK
Thanks for chiming in Chris. Our logic provides an intermediate layer that, among other things, is in charge of starting the ad. That being said, we need to handle 'initAd', 'startAd', and all other VPAID methods. Can you elaborate on how we can overcome this issue when dealing with your SDK in secure mode?

Seeing as we start the ad, our logic needs to determine whether autoplay is allowed. So far, our logic works in every environment we've tested in besides IMA secure mode. We're hoping to avoid having IMA specific logic in our ad layer, as our logic is universal and used to serve many ads across many publishers.

ima-sdk-adv...@google.com

unread,
Mar 21, 2018, 3:17:27 PM3/21/18
to ima...@googlegroups.com
Hi Leandro,

If your VPAID implementation requires access to the page DOM, it won't be compatible with our ENABLED mode. For these ads, you'll need to use INSECURE mode. You can read more about how our SDK interacts with VPAID on this page.

Regards,
Chris Feldman
IMA SDK Team

=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+ page:
    http://googleadsdeveloper.blogspot.com
    https://plus.google.com/115658573333388777174/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

Oren Melamed

unread,
Mar 30, 2018, 4:21:39 AM3/30/18
to Interactive Media Ads SDK
Leandro, if you run in secure mode then your vpaid runs in an IFRAME and it could be that the new feature policies are preventing you from autoplay.

By the way, if this is the case and your promise is not resolving I would say this sounds like a bug, as it would be expected that if autoplay policy is not set/allowed then promise will be rejected.
Reply all
Reply to author
Forward
0 new messages