error: "Prevented playback initiated without user interaction"

3,488 views
Skip to first unread message

Vincent van Laar

unread,
Nov 3, 2017, 7:04:16 AM11/3/17
to Interactive Media Ads SDK
Hi there,

Since yesterday (November 2, 2017) around 16:00 CET we're getting a lot more instances of the following error:

Ad error: AdError 400: There was an error playing the video ad. Caused by: Error: AdError 1205: The browser prevented playback initiated without user interaction.

We do start our player by using the Javascript API in some cases, but as far as i know, playing muted video content shouldn't be an issue.

I don't see anything in your release notes, but seeing the errors across all browsers so the only change i can think of would be in the IMA SDK.

Are you perhaps testing a new release?

Thanks!

Vincent


Michael Arguin

unread,
Nov 3, 2017, 9:11:28 AM11/3/17
to Interactive Media Ads SDK
Looks like they did.  "google.ima.VERSION","3.184.1" in the current release at http://imasdk.googleapis.com/js/sdkloader/ima3.js

From a quick perusal at the code, it appears that error is thrown when "autoplayDisallowed" though I'm not sure if they are checking the play.promise() rejection or simply checking for the presence of autoplay without muted on the video element. In those cases, it appears to be canceling the ad altogether.

This is a regression for us though as previously the browser would throw an exception but the ad would still be playable if the user clicked play. Now the ad is completely gone.

It "works" in their Advanced Autoplay sample because they do not use the autoplay attribute and use muted with playsinline: https://chris-feldman.github.io/ima-samples/advanced-autoplay/

Chris Feldman (IMA SDK Team)

unread,
Nov 3, 2017, 1:37:25 PM11/3/17
to Interactive Media Ads SDK
Hi Vincent,

This change does stem from a newly released version of the SDK. The release notes have now been update accordingly. You can also look out for an upcoming blog post that will help further break down the changes.

Our team never intended for publishers to use the 'autoplay' attribute on their video players because it can't trigger SDK playback, only content. Our autoplay guides lay out how to use a sort of simulated autoplay where an adRequest is made on page load and then adsManager.start() is called as soon as the ads are loaded. If possible, could you share some information about your workflow and how your autoplay implementation worked? I'm not familiar with any methods for using the 'autoplay' attribute as you've described.

Regards,
Chris Feldman
IMA SDK Team

Vincent van Laar

unread,
Nov 6, 2017, 8:15:50 AM11/6/17
to Interactive Media Ads SDK
Hi Chris,

Thanks for your response.

We are getting the "Prevented playback initiated without user interaction"-error on the current desktop version 62 of Chrome as well. I don't think this version of Chrome should ever throw this error right? I did read about the Chrome 64 not allowing autoplay with sound with an option, but that isn't in place yet right?

You can see the issue here (press "Submit" once to load the ad):

It really feels as if this error is being thrown too often and would appreciate if you would recheck the code changes surrounding this error.

Also, i did not mention the autoplay attribute (that was Michael) on the video element, so that's not the issue for me at least.

Thanks again,
Vincent

Vincent van Laar

unread,
Nov 6, 2017, 8:59:02 AM11/6/17
to Interactive Media Ads SDK
One more thing to add:

The issue Michael is raising is indeed also an issue for us. The error is thrown and the CONTENT_RESUME_REQUESTED event is thrown afterwards which means there is no possibility to retry playing the ad with a user action.

-Vincent

Chris Feldman (IMA SDK Team)

unread,
Nov 6, 2017, 12:57:54 PM11/6/17
to Interactive Media Ads SDK
Hi Vincent,

Can you share some more information about how you're implementing autoplay? The "simulated" autoplay method that I described in my last post, and laid out here in more detail, plays correctly on both Chrome and Safari.

The code for the page you linked is obfuscated so I can't dig into your implementation. If you can describe your page's workflow, or link an unobfuscated page, I should be able to shed further light on what is happening and whether or not your use case is meant to be supported.

 We are also prepping a blog post that will detail our recommended method for falling back to click-to-play if autoplay is not available.

Regards,
Chris Feldman
IMA SDK Team

Vincent van Laar

unread,
Nov 7, 2017, 6:46:50 AM11/7/17
to Interactive Media Ads SDK
Hi Chris,

We've found the issue in our implementation.

In some cases we would call adsManager.resume right after adsManager.start.

This probably resulted in another Promise error and the IMA component would give this misleading "Prevented playback initiated without user interaction" error. It would be good if the error-code and message of the Promise error would be checked, and would be correctly handled accordingly.

Hope this helps.

Regards,
Vincent

Alexander Eng

unread,
Nov 13, 2017, 8:14:37 PM11/13/17
to Interactive Media Ads SDK
Hi Chris,

Do you know of an approximate date for the fallback blog post you mentioned above? We're trying to fallback to muted ad playback after detecting the "AdError 1205: The browser prevented playback initiated without user interaction." error, but in every scenario we've tested the ad/ad break is destroyed when the error is thrown with no way of resuming it outside of making the ad request again. Any tips you can include here on how to do this will be greatly appreciated as well. Thanks!

Regards,
Alex

Chris Feldman (IMA SDK Team)

unread,
Nov 14, 2017, 11:02:52 AM11/14/17
to Interactive Media Ads SDK
Hi Alex,

The blog post is not yet ready. However, in the meantime, you can take a look at our new attempt_to_autoplay sample on GitHub. The eventual blog post will go into more detail, but you should be able to get a good sense of the workflow from the sample. You can view the page live here. You'll notice that autoplay will be used where possible, otherwise it will fallback to showing a play button.

Regards,
Chris Feldman
IMA SDK Team

Alexander Eng

unread,
Nov 14, 2017, 5:51:35 PM11/14/17
to Interactive Media Ads SDK
Hi Chris,

Thanks for the fast response! I've looked over the sample and it looks like it relies on testing the content video to see if it can autoplay. Is there an approach that does not rely on the content video? We integrate with some 3rd party libraries to playback content that do not have a video element exposed for us to pass to the IMA SDK. 

If we can get a non-fatal event or callback for when autoplay fails with IMA, this would be perfect. Right now the AdError 1205 error destroys the ad/ad break, so we cannot fallback outside of making another ad request, which adds additional latency and becomes problematic when dealing with ad rules ads. We'd like, if possible, to follow the paradigm specified by Apple here:


Instead of detecting when the play promise is rejected, we'd like to listen to the AdError 1205 (or something similar) instead. Let me know, thanks!

Regards,
Alex

Shawn Busolits (IMA SDK Team)

unread,
Nov 21, 2017, 5:31:11 PM11/21/17
to Interactive Media Ads SDK
Hi Alexander,

We don't have an approach that doesn't rely on the content video. The only way to check if autoplay is supported or not is to attempt to play a video, as you noted, so you'll need access to the content video for that.

Currently any failed attempt to play an ad is considered fatal by the SDK, hence why we need to throw a 400 error and discard the break. Once we fail to play that ad we send an error ping to the ad server. If we added the ability to try to play that ad after it fails, the server would see an error ping followed by tracking pings indicating that there *wasn't* an error, which wouldn't make sense. I'll take your feedback to the rest of the team, but we did put a considerable amount of thought into the current implementation when we decided to handle it as it's handled now.

Thanks,
Shawn Busolits
IMA SDK Team
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted

Alexander Eng

unread,
Nov 21, 2017, 7:54:20 PM11/21/17
to Interactive Media Ads SDK
Hi Shawn,

Thanks for the update! We'll try to work around this in the meanwhile. However, I've observed two things with the current approach in the sample Chris gave (http://googleads.github.io/googleads-ima-html5/attempt_to_autoplay/, tested on Safari 11 macOS):

1. Let's say the ad tag is an Ad Rules ad tag with a single midroll. If the content starts autoplaying via muted autoplay, and is unmuted by the user before the midroll but after content start, the midroll will play muted. You can observe this by proxying/replacing 'ads.js' in http://googleads.github.io/googleads-ima-html5/attempt_to_autoplay/ with the attached file 'mutedAutoplayAdRules.js.' You can unmute the content by clicking anywhere in the document once the content starts. What can we do to enable volume for the Ad Rules midroll since the user has interacted, but after IMA has been setup and the ad rules ad tag has already been requested? 

2. Let's say the ad tag is a regular ad tag that we will process at 10 seconds into the video as a non-Ad Rules midroll. If the content starts autoplaying via muted autoplay, and is unmuted by the user before the midroll but after content start, the midroll will error and not play. You can observe this by proxying/replacing 'ads.js' in http://googleads.github.io/googleads-ima-html5/attempt_to_autoplay/ with the attached file 'mutedAutoplay.js.' You can unmute the content by clicking anywhere in the document once the content starts.  The unmuted autoplay check in the sample passes since the content can autoplay unmuted because of the user click to unmute, but the IMA ad still errors out. Is this something that needs to be fixed by the IMA HTML5 SDK?

Both of these scenarios work fine if the user does not unmute the content. Please let me what should be done with these two scenarios. Thanks!

Regards,
Alex

Alexander Eng

unread,
Nov 21, 2017, 7:57:59 PM11/21/17
to Interactive Media Ads SDK
Sorry I was unable to post a reply with attached files. I've hosted the two files I mentioned in my last reply here:


Regards,
Alex

Shawn Busolits (IMA SDK Team)

unread,
Nov 22, 2017, 11:47:05 AM11/22/17
to Interactive Media Ads SDK
Hi Alex,

I think you should be able to work around both of these issues by using the user action that unmutes the video to also initialize the ad display container. I've outlined a potential solution for each below - let me know if this would work for you.

- Ad rules tag with a single mid-roll
When the user clicks the page and you unmute the content video, you can also call adDisplayContainer.initialize() and adsManager.setVolume(1) in that click listener. When the mid-roll arrives, it will play without error.

- Single ad delayed to act like a mid-roll
When the user clicks the page and you unmute the content video, you can also call adDisplayContainer.initialize() in that click listener. This should allow the ad to play without error.

Let me know if this works for you.

Thanks!
Shawn Busolits
IMA SDK Team
Reply all
Reply to author
Forward
0 new messages