Initial-user-action requirement on mobile
On desktop, we pretty much have everything working.
On mobile, however, we can't seem to get around the "initial user action" requirement. The problem is this: our wrapper doesn't even load on the page until the user clicks "play" in JW player. The reasons for this are many, not the least of which is that we need environmentVars passed to initAd in order to know where to render the ad node, and in order to establish a link to the video player which may even be cross-domain to where our script is injected (in which case we couldn't wire events to its controls even if we wanted to).
In other words, we do not "own" the video player. We're a VPAID wrapper which should work with any HTML5 VPAID compliant player, including JW.
So, long story short, if on initAd we attach a "touchstart" (or similar) event to the adSlot, and then call initialization code when that event is triggered, the ad does play. In practice, this basically looks like this: the user clicks "play", the player shows a spinner with "loading ad" -- and if the user touches the player (the adSlot, rather) within the default 15-second timeout, the ad plays.
Obviously, we cannot require the user to do this in the real world.
If, however, I try to trigger the event programmatically -- I've tried both touch and mouse events -- things seem normal until adsManager_.start() is called. Then, the player seems to display the first frame of the ad but it fails to play it further. 15 seconds later, we get a timeout.
So basically, our VPAID wrapper script doesn't even load on the page until the user clicks "play" in JW player. Once our script loads, we cannot require the user to issue yet another "real" physical event. We want the ad to play when our script loads without requiring another physical user action.
Any way around this?
Thanks in advance!