Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

Ads not playing automatically


On Android with sdk version 17 and 23, using the mobile sdk with ad license. playing video automatically is no problem. When I add a preroll video ad via a VAST URL, though, the ad is loaded automatically (I see "Loading ad"). Then I see a black screen and a pause button like the ad is playing, but no sound, no video, nothing, indefinitely. When I click pause and then click the play button that appears in its place, the video ad does start playing and the actual video follows seamlessly.
Interestingly, as soon as the video ad is loaded and the black screen shows initially, I consistently get this message in the logs:

[INFO:CONSOLE(0)] "Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture."

All that I have found online is that this is a core behavior of Chromium (Android Webviews) to protect users from wasting data on automatically playing videos. But I just cannot imagine that JW player has not worked around this somehow. Halp!

6 Community Answers

jessevanmuijden

User  
0 rated :

p.s. no issues whatsoever with the same ad and video on ios. VAST URL tested in jw player's VAST URL tester.

George

JW Player Support Agent  
0 rated :

Hi please email support+sdk@jwplayer.com with the following info:

Company name:
Customer e-mail address:
Customer JW Player license key:
Android API Build level (16,17… 22):
IDE (eg. Android Studio) version number:
JW Player SDK for Android version number:
Device make and model where you are experiencing this issue:
Provide step by step instructions on how to reproduce your issue:
JW Player Demo Application Source Code that is also experiencing the issue:

As the last field suggests, please replicate this issue using the JW Player Demo Application and send us a zipped version of the entire Android Studio Project for testing which can be found here:
https://github.com/jwplayer/jwplayer-sdk-android-demo

jessevanmuijden

User  
0 rated :

ok. I replicated the issue with the demo application. Sending an e-mail now.

George

JW Player Support Agent  
0 rated :

Cool, we’ll continue on the email thread

jessevanmuijden

User  
0 rated :

For future reference: SpotX provided a URL including a query parameter (?VPAID=JS) for use in the iOS app. We used it for the Android app, but at the current time VPAID2 is not supported on the Android SDK.

Chris

User  
1 rated :

If a user doesn't want videos to autoplay - and there are many valid reasons why they wouldn't - please respect their preference. DO NOT "work around this somehow".

This question has received the maximum number of answers.