-
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
Autoplay detection library: initial release && Teads Bid Adapter: detect autoplay #11222
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👌
// followed by: | ||
// echo "data:video/mp4;base64,$(base64 -i autoplay.mp4)" | ||
|
||
const autoplayVideoUrl = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
much happier this worked than sourcing an external file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think startDetection
can be called in the library .
This is great stuff!
modules/teadsBidAdapter.js
Outdated
|
||
/** | ||
* @typedef {import('../src/adapters/bidderFactory.js').BidRequest} BidRequest | ||
* @typedef {import('../src/adapters/bidderFactory.js').Bid} Bid | ||
*/ | ||
|
||
// start autoplay detection as soon as Prebid is loading | ||
startDetection(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not call this in autoplay.js
? Every module using this library will need to do it, so might as well do it in the library. I can't think of a case where a module would want to delay this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good point, this makes sense since libraries are not included by default, so the detection will only run if a module includes it. I'll make the change!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By doing that, we can also remove the detectionInProgress
logic, since the code is executed once when the module is initialized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in ed3427c
…ect autoplay (prebid#11222) * Add autoplay library * Filter out bids with needAutoplay if autoplay is disabled * Refactoring + add test * Simplify logic for filtering bids * Start detection in autoplay.js directly
Hi @github-matthieu-wipliez @karimMourra @patmmccann. We have detected a problem in an iOS APP using webviews that includes a Prebid file with the Teads adapter (that includes the autoplay library which It seems the webview opens this 1s videoplayer on fullscreen automatically. Any ideas or suggestions about this issue? Thanks! |
Hi @aanton yes you should allow inline media playback, see this issue for details: #11438 Thanks, |
Thanks @github-matthieu-wipliez! |
Type of change
Bugfix
Feature
New bidder adapter
Code style update (formatting, local variables)
Refactoring (no functional changes, no api changes)
Build related changes
CI related changes
Does this change affect user-facing APIs or examples documented on http://prebid.org?
Other
Description of change
This PR adds an autoplay detection library, and updates the Teads adapter to use this feature to filter out bid responses containing ads that require autoplay when autoplay is not enabled on the browser.
The autoplay detection library works by attempting to play a 1-frame, 1 second video of a 160x90 pixels black image without sound, encoded with ffmpeg as H.264 wrapped in an MP4. I reduced its size by stripping the unneeded encoder details. The
play()
promise fails immediately when the OS does not allow autoplay, but when autoplay is allowed the promise does not necessarily resolve right away, hence the choice to consider that autoplay is enabled by default unless it has been explicitly forbidden. Note that the video does not need to be in the DOM for this to work, which makes this easier. We have tested this in production on our side.For context see preliminary discussion on Slack: https://prebid.slack.com/archives/C7TLBVAH3/p1709305698637079
Other information