videojs-ima: [iOS/Safari] AdError 400: There was an error playing the video ad. Caused by: AdError 1205: The browser prevented playback initiated without user interaction.
Hi!
We’re using VideoJS 7.5.5 and the videojs-ima plugin. We’re having issues playing preroll linear ads in iOS.
Initially, the first issues we got was the error Error 200 - The provided ad type: skippablevideo is not supported.
.
After searching online, we found that adding the playsinline
attribute on video tag and the disableCustomPlaybackForIOS10Plus: true
in the SDK config should fix that problem. but did the changes and it does not work, and now is showing another error: Ad error: AdError 400: There was an error playing the video ad. Caused by: AdError 1205: The browser prevented playback initiated without user interaction.
The thing is, the player did not have autoplay on, we use can-autoplay
and only set autoplay config if is allowed with sound, otherwise we set autoplay false. And in this case, the player is not autoplaying, and the user’s click to play was required, but somehow the ads triggered that error that needed user interaction when there was one.
Here I have a demo page with a preview ad that it can show the error http://pubads.g.doubleclick.net/gampad/preview_cookie?gct=B1_UT7D8NdAYpfHg5wUwpY2W7wWIAYCAgKDH1Jq0rQE&op=set&redirect=https://player-qa.gfrvideo.com/player/255502.html?autostart%3Dtrue&redirect_hash=AJlzBa3G3G748uARIaCshj8gNCKxUfzFvQ&lineItemId=5076730461&creativeId=138271786265
Has anyone seen this issue?
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 2
- Comments: 23
This link helped alot:
https://developers.google.com/interactive-media-ads/docs/sdks/html5/autoplay#autoplay_on_iphone
When I create the video element for the player to attach to I specify these properties explicitly on iPad or iPhone:
muted playsinline
<video id="contentElement" playsinline muted> <source src="https://storage.googleapis.com/gvabox/media/samples/stock.mp4"></source> </video>
BUT THAT IS NOT ENOUGH:
When I initialize the videoJS player via an options argument I make sure to set muted to true there as well so as not to override what I put in the html above:
// if apple device videojs(‘contentElement’, { muted: true, … other options);
you should use adWillAutoPlay and adWillPlayMuted
Hi,
I’ve investigated the test page you shared and noticed that you have a url parameter called autostart set to true, this is causing your video content to autoplay. If you set it to false, the
UNMUTED AUTOPLAY IS NOT ALLOWED
and theAdError 400: There was an error playing the video ad. Caused by: AdError 1205: The browser prevented playback initiated without user interaction.
messages will disappear. On the other hand, if you want to autoplay your videos, the video player must be muted and the videojs-ima plugin options must haveadWillPlayMuted : true
.