-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Teads: AutoplayDetection causes fullscreen video on WKWebView #11438
Comments
fwiw only Teads adapter uses this. One solution could be to disable Teads while the fix is pending. |
Hi @webberig, sorry for the trouble! I'm not sure why the video is displayed as the I would have been very happy to use a standard feature, unfortunately the getAutoplayPolicy is only available on Firefox :/ |
Hi again, I have failed to reproduce it locally using a WKWebView with a configuration that sets How is Prebid.js loaded? Do you have something else specific on your WKWebView? I'm trying to find a way to reproduce it so I can find a way to fix it |
@github-matthieu-wipliez does your cordova config support AllowInlineMediaPlayback for iOS? (https://cordova.apache.org/docs/en/3.2.0/guide/platforms/ios/config.html) It would appear the autoplay detection would be great, but is unsupported at this time on most browsers. If you check the doc link above I think there is a solution you could try in there? |
Hi @webberig, good news, I've managed to reproduce the bug! @whatadewitt I don't use Cordova, I'm directly testing in an iOS app using a WKWebView with a custom configuration. I had not set That being said, the Teads ad player appears to assume that I see several ways to fix this:
What do you think? |
Thanks for the efforts @github-matthieu-wipliez! It appears that the cordova ionic-webview has an undocumented configuration which allows us to set the It would be an improvement to prebid if you were able to detect that inline playback is allowed or not. Not just for the mock video, but for real ads too. Displaying ads in a fullscreen native player is probably not desirable ;-) |
Great! I have tried to see if there was a way to detect if the video plays inline or not, and it seems that it's only possible to do that after the video has started playing (so it's already playing in fullscreen). After discussing with my colleagues, our Teads player is only supposed to be used in an environment where |
Apologies @github-matthieu-wipliez I tagged you in my response where I should have tagged @webberig -- regardless, glad you are sorted :) |
@github-matthieu-wipliez we'll discuss in committee tomorrow. I'm not familiar enough with how often this may occur to weigh in |
Could the "autoplay detection" feature be optional to avoid this issue on current iOS APPs that does not have the proper configuration? |
Something I don't quite understand is that this feature has been part of the Teads ad player for years without any issues. Do you have the Teads adapter enabled by default but not configured? Is it playing any ads? |
We use the Teads adapter in our Prebid integration, but only with banner media types. After a recent upgrade of the Prebid version, this issue has appeared. It is related to the automatic "autoplay detection" recently added in Prebid.js/libraries/autoplayDetection/autoplay.js Lines 41 to 42 in 7ab6165
That code was not included in previous versions of the Teads adapter (I have looked for it in 8.36.0 version). About using the "Teads ad player", I am not sure about it. I don't know the resources used when Teads wins the auction and its creative is displayed. As I have commented, we only use the Teads adapter for banner media types. Thanks for your help! |
Discussed in the PMC, and we should also add this situation to our documentation as other bidders may also run into this problem. |
Hi @aanton, what I mean is that while the adapter did not include this code, the Teads ad player runs this code as soon as it starts, regardless of the media type. What did change though is that the video used to be fetched from an external URL, and was one frame long, whereas the new video is embedded and is 1 second long. I will try changing this and see if the video still opens.
@lcorrigall Hi Luke, I'm not sure what documentation you're referring to, should this be part of the general Prebid.js guidelines? |
I just tried, and same thing 🤷 |
In my opinion, in the current version the autoplay code always runs if the Prebid file includes the Teads bids adapter, but in the previous versions it didn't. In the previous versions (before 8.42.0), the Teads ad player was only included if the Teads bid was the winner bid in Prebid and, also, the ad server didn't have a better campaign to show (like a more expensive campaign). So the problem always happens with the newer Prebid version (if it includes de Teads bi adapter) but in the previous versions it only happened in some cases (if the Teads creative was displayed). |
That's right, from what I see there was no ad served on zimmo (in 2024), which could explain why you never noticed the problem. |
@github-matthieu-wipliez : Luke is referring to the reference page on building a bidder https://docs.prebid.org/dev-docs/bidder-adaptor.html |
Hi everyone, We are facing the same issue. Our application, which has tens of thousands of iOS users in Japan, has been significantly impacted by this problem. We have confirmed that the changes made to autoplay.js from version 8.42.0 are the cause, and therefore we downgraded to 8.41.0. It is not advisable to show full-screen videos to all users of an iOS app just to verify if autoplay is enabled. Please consider that in WKWebView, the default value for And as far as I know, this trick works on iOS 16 and does not play the video, but it does play the video on iOS 17+. Thank you |
Hi @kohashi,
I'm sorry for the inconvenience. This library is opt-in, are you using the Teads adapter? Can you disable it? Or perhaps another option would be to use our inApp SDK?
My point is that if you integrate the Teads adapter, there's a good chance it will show you a video ad (as maybe 40% of our ads are videos), so you should have
The video element is not added to the DOM, so the video is played but never shown. This autoplay detection has been part of our ad player for years without problem 🤷
I hope I have answered your concerns. Matthieu |
Thanks for the suggestions, I'll let the others comment. I have also opened a PR on the documentation of our adapter to state that we require playsinline: Add note for playinline for Teads adapter |
Hi @github-matthieu-wipliez. Let me share my point about your comment.
In our case, we have been using 5 Prebid bidders (including Teads), TAM and GAM (with our own campaigns, its programmatic, ...) for a long time. The Teads winning rate is low (there are many competitors) so we did not notice the problem in previous Prebid versions. The impact was quite low. |
We manage ads for several websites, some of which are also offered as app versions. For management reasons, we use the same prebid.js across all sites and app versions. Currently, we have chosen to continue using Teads at version 8.41.0 without updating it.
Our investigation and testing have identified this Pull Request, created on Mar 20 this year, as the cause of the issue. Regarding whether there were any issues before this, as @aanton mentioned, it is possible that the problem was not reported because Teads was not winning many bids on iOS apps. We are serious about wanting to keep the Teads module updated. |
Hi @kohashi, it does not seem possible to detect if That said, as I said before in this thread, while this will fix the autoplay detection, having an app with a WebView using Matthieu |
Thanks for the good information! Kohashi |
Thanks for the update! Normally, I wouldn't be concerned with this share, Could you add code to exclude iOS 16 and below in your code?
Another idea would be pbjs.setConfig.
Looking forward to your feedback! Thanks, |
Hi @kohashi thanks for your suggestion! I have tried it on the Simulator with my sample WebView on iPhone 16 and 17, it appears that I'll keep you posted. Thanks, |
Hi again, I have updated my PR accordingly, see this commit. In the case of iOS 16.x in a web view, autoplay detection is skipped, but autoplay will still be considered enabled (since typically 97% of users have autoplay enabled). |
It looks almost perfect! I can't think of a solution. There will be issues with fullscreen videos in iPad 16-, but I believe that iPad users tend to use newer versions of the OS compared to iPhone users, so I want to incorporate this change. Thanks for everything. |
Type of issue
Bug
Description
We encountered some strange behavior in our mobile app after updating prebid.js. A full screen native media player appears with a black 1-second video.
20240430_upd_r200_ios_black_overlay.mp4
This is caused by the autoplay detection:
https://github.com/prebid/Prebid.js/blob/7ab6165e342294fafa087135af219f3f88f0e220/libraries/autoplayDetection/autoplay.js
The app is built using Cordova and Ionic which uses a WKWebView component to render the web application. Apparently, WKWebView has a property allowsInlineMediaPlayback which - when turned off - forces video content to be displayed in a native fullscreen controller.
This property is turned off by default on iPhone, turned on by default on iPad.
The autoplay detection of prebid.js plays a small video to determine wether autoplay is supported, which is invisible in most common browsers but seems to have a disturbing side effect in WKWebView.
Steps to reproduce
This can only be reproduced in a native iOS application using a WKWebView which in turn contains a webpage that is running prebid.js.
Test page
Providing a demo app has little use as you need to have XCode installed and run the app in Simulator. One does not simply install an app from unknown origin on iPhones ;-)
I'm hoping the WKWebView documentation is enough to prove the bug being presented.
Expected results
prebid.js should not bother a user with a fullscreen 1s black video. The current approach can be considered hacky at best, so I would recommend looking at proper feature detection such as this draft spec: https://www.w3.org/TR/autoplay-detection/
Actual results
As soon as prebid.js is loaded, the user gets a fullscreen 1s black video. After closing it (by swiping or a close button in a corner of the screen), normal behavior is resumed.
Platform details
Tested with prebid.js v8.45.0
Browser is a WKWebView inside a native iOS mobile app, built using XCode 15.3. According to docs, this property is present in iOS version >= 8.0
Other information
The text was updated successfully, but these errors were encountered: