IMA returns 402 after moving player within session in React

74 views
Skip to first unread message

Matt Iakhno

unread,
Oct 22, 2020, 3:52:41 PM10/22/20
to Interactive Media Ads SDK
Hi IMA team,

I've been battling with this one for 3 days now, and am all out of ideas. We are building an SPA (React) where we'd like to maintain the player between pages. The issue we've run into is if the player loads a VMAP tag on one page, and then we move it anywhere else, all subsequent ad requests return a 402 and the IMA SDK times out on playback.

A link to reproduce this issue is available here:


Steps to reproduce:
1. Select an ad tag from the dropdown (eg "VMAP Postroll")
2. Press the "Play Ads" button below the player (3rd button)
3. After playback begins, press the "Move Player" button
4. Now, request a different ad (eg "VMAP Preroll")
5. Press the "Play Ads" button again - ad will not play.

Output:

[ima.admanager.VideoAdManager] Playback error: [object Object] AdError 402: VAST media file loading reached a timeout of 8 seconds. 
bridge3.418.3_debug_en.html:929  [ 11.197s] [UrlReporter] Reporting urls for event : error 
bridge3.418.3_debug_en.html:929  [ 11.199s] [ima.common.ErrorUtils] Error play dispatched: AdError 402: VAST media file loading reached a timeout of 8 seconds.


Although the above is a CodePen, the behavior in my SPA environment is identical (including me moving the player with .appendChild() )

How can I "reset" the IMA SDK after repositioning it? Do I need to somehow perform a more "full" teardown of the SDK, and if so - how? At this point it is not realistic for me to dispose of the entire player and re-render it.

Thank you in advance for your help.
Best,
Matt

IMA SDK

unread,
Oct 22, 2020, 11:05:56 PM10/22/20
to ma...@dotstudioz.com, ima...@googlegroups.com

Hi Matt,

Thank you for reporting this to us.

Could you provide more details on why you want to move the video player element? I’m asking this because the use case you’re trying to achieve here is not supported by the SDK. The element should already be in place properly before ads are being requested and played.

Regards,

Google Logo
Sherwin Diesta
IMA SDK Team
 


ref:_00D1U1174p._5004Q26BRds:ref

Matt Iakhno

unread,
Oct 23, 2020, 11:23:47 AM10/23/20
to Interactive Media Ads SDK
Hi Sherwin,

Thank you for your response. We will change our app to fully dispose of the player on route change.

IMA SDK

unread,
Oct 23, 2020, 9:06:28 PM10/23/20
to ma...@dotstudioz.com, ima...@googlegroups.com
Hi Matt,

Thank you for the response back. I work along with Sherwin, and will assisting you today with this issue. Having looked over the original post. I would ask what kind of SPA are you building, and why not just pull the ad into its own component? Thus it does not have to be affected by the routes of your main component. This will not require it to be reloaded each time you changed the route.

Also with the 402 this would seem to indicate more of an issue with the implementation of the SDK once the routes are being changed. As the moving of the player in the DOM is both not supported by the SDK and is actually not recommended.

Regards,
Google Logo
William Pescherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q26BRds:ref
Reply all
Reply to author
Forward
0 new messages