diff --git a/modules/seedtagBidAdapter.js b/modules/seedtagBidAdapter.js index e32d34c9260..95a7713de5b 100644 --- a/modules/seedtagBidAdapter.js +++ b/modules/seedtagBidAdapter.js @@ -4,6 +4,7 @@ import { BANNER, VIDEO } from '../src/mediaTypes.js'; import { _map, getWinDimensions, isArray, triggerPixel } from '../src/utils.js'; import { getViewportCoordinates } from '../libraries/viewport/viewport.js'; import { getConnectionInfo } from '../libraries/connectionInfo/connectionUtils.js'; +import { isAutoplayEnabled } from '../libraries/autoplayDetection/autoplay.js'; import { getAdUnitElement } from '../src/utils/adUnits.js'; /** @@ -304,6 +305,7 @@ export const spec = { timeout: bidderRequest.timeout, version: '$prebid.version$', connectionType: getConnectionType(), + autoplay: isAutoplayEnabled(), auctionStart: bidderRequest.auctionStart || Date.now(), ttfb: ttfb(), bidRequests: _map(validBidRequests, buildBidRequest), diff --git a/test/spec/modules/seedtagBidAdapter_spec.js b/test/spec/modules/seedtagBidAdapter_spec.js index 00a8f9027fa..bb435461e25 100644 --- a/test/spec/modules/seedtagBidAdapter_spec.js +++ b/test/spec/modules/seedtagBidAdapter_spec.js @@ -1,6 +1,7 @@ import { expect } from 'chai'; import { getTimeoutUrl, spec, BIDFLOOR_CURRENCY } from 'modules/seedtagBidAdapter.js'; import * as utils from 'src/utils.js'; +import * as autoplay from 'libraries/autoplayDetection/autoplay.js'; import * as mockGpt from 'test/spec/integration/faker/googletag.js'; import * as adUnits from 'src/utils/adUnits'; @@ -750,6 +751,26 @@ describe('Seedtag Adapter', function () { expect(data.ortb).to.be.undefined; }); }); + + describe('autoplay param', function () { + let isAutoplayEnabledStub; + + afterEach(function () { + isAutoplayEnabledStub.restore(); + }); + + it('should send autoplay = true when autoplay is not forbidden', function () { + isAutoplayEnabledStub = sinon.stub(autoplay, 'isAutoplayEnabled').returns(true); + const data = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); + expect(data.autoplay).to.equal(true); + }); + + it('should send autoplay = false when autoplay is forbidden', function () { + isAutoplayEnabledStub = sinon.stub(autoplay, 'isAutoplayEnabled').returns(false); + const data = JSON.parse(spec.buildRequests(validBidRequests, bidderRequest).data); + expect(data.autoplay).to.equal(false); + }); + }); }); describe('interpret response method', function () { it('should return a void array, when the server response are not correct.', function () {