Skip to content
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

Instream and Outstream video support for medianetBidAdapter #5482

Merged
merged 5 commits into from
Jul 29, 2020

Conversation

c3p-0
Copy link
Contributor

@c3p-0 c3p-0 commented Jul 10, 2020

Type of change

  • Feature

Description of change

Instream and Outstream video support for medianetBidAdapter

@c3p-0 c3p-0 marked this pull request as ready for review July 17, 2020 07:59
@c3p-0 c3p-0 changed the title WIP : Instream and Outstream video support for medianetBidAdapter Instream and Outstream video support for medianetBidAdapter Jul 17, 2020
@c3p-0
Copy link
Contributor Author

c3p-0 commented Jul 17, 2020

@bretg @Fawke @jaiminpanchal27 can you please review this PR and let me know your thoughts?

Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3p-0,

Thanks for the PR. I've gone through your changes and found few things you wanna look at:

  • Can you please remove all the references to the adUnit.sizes property from all the examples in the md file? I know, it's not related to this change, but, it can be confusing for someone new, since we've deprecated adUnit.sizes property from version 3 onwards.

  • I tried to plug in this adUnit to get a response back, but getting an error. Can you check?

AdUnit:

[{
        code: 'div-gpt-ad-1460505748561-0',
        sizes: [640, 480],
        mediaTypes: {
            video: {
                context: "instream",
                playerSize: [640, 480]
            }
        },
        bids: [{
            bidder: 'medianet',
            params: {
                cid: '8CUX0H51C',
                video: {
                    mimes: ['video/mp4']
                }
            }
        }]
    }];

ERROR::
Screenshot 2020-07-23 at 5 20 49 PM

I get the same error when I try outstream.

  • Can you create a docs PR for prebid.org? Since you are adding support for a new mediaType, it can be listed under supported media types for your bid adapter.

@c3p-0
Copy link
Contributor Author

c3p-0 commented Jul 24, 2020

@Fawke thanks for your feedback. I have incorporated all of the changes. Please have a look.
Here is the link of docs PR: prebid/prebid.github.io#2160

@Fawke
Copy link
Contributor

Fawke commented Jul 27, 2020

Hi @c3p-0,

Thanks for making the changes. But, still am not getting a vid bid response back from 'https://prebid.media.net/rtb/prebid';. It throws an error (refer to the screenshot above).

Also, we just release Prebid v4.0 few days back. You can read the blogpost for more details on the new changes.

If you read the Moving Towards Standardization section, you'll notice that we are now enforcing moving video params, which I see you're currently passing under params object, will move here mediaTypes.video object.

If @bretg or someone else approves the docs PR, then it's probably okay, no need to make the change, otherwise, you need to change the location of the video params.

@Fawke Fawke removed the needs docs label Jul 27, 2020
@c3p-0
Copy link
Contributor Author

c3p-0 commented Jul 27, 2020

Hi, @Fawke with following AdUnit:

var videoAdUnit = {
	code: 'video1',
	mediaTypes: {
		video: {
			context: "instream",
			playerSize: [640, 480]
		}
	},
	bids: [{
		bidder: 'medianet',
		params: {
			cid: '8CUX0H51C',
			video: {
				mimes: ['video/mp4'],
				placement: 1
			},
			// Site member is to be used only for testing
			site: {
				page: 'http://smoketesting.net/prebidtest/',
				domain: 'smoketesting.net',
				ref: 'http://smoketesting.net/prebidtest/'
			}
		}
	}]
};

I am getting following response from https://prebid.media.net/rtb/prebid

{
	"id": "cae7aed1-1a06-4dc6-b6e3-2024d3745a41",
	"bidList": [{
		"no_bid": false,
		"requestId": "283edb14e445b",
		"cpm": 12.00,
		"width": 640,
		"height": 480,
		"ttl": 180,
		"creativeId": "370637746",
		"netRevenue": true,
		"vastXml": "\u003c?xml version\u003d\"1.0\" encoding\u003d\"UTF-8\" standalone\u003d\"yes\"?\u003e\u003cVAST version\u003d\"3.0\"\u003e\u003cAd id\u003d\"97517771\"\u003e\u003cInLine\u003e\u003cAdSystem\u003eadnxs\u003c/AdSystem\u003e\u003cAdTitle\u003e\u003c![CDATA[AppNexus Viewability Wrapper]]\u003e\u003c/AdTitle\u003e\u003cError\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d4\u0026error_code\u003d[ERRORCODE]]]\u003e\u003c/Error\u003e\u003cImpression id\u003d\"adnxs\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/it?an_audit\u003d0\u0026referrer\u003dhttp%3A%2F%2Fprebid.org%2Fexamples%2Fvideo%2Finstream%2Fflowplayer%2Fpb-ve-flowplayer.html\u0026e\u003dwqT_3QLGCaDGBAAAAwDWAAUBCLX0kPgFEPKY74n3q4fhFxitveaB25XZkx8qNgkAAAECCBRAEQEHNAAAFEAZAAAA4HoUFEAhERIAKREJADERG6gw6dGnBjjtSEDtSEgCUMuBwC5YnPFbYABozbp1eI-4BYABAYoBA1VTRJIBAQbwUpgBAaABAagBAbABALgBA8ABBMgBAtABANgBAOABAPABAIoCO3VmKCdhJywgMjUyOTg4NSwgMTU5NDExMjU2NSk7dWYoJ3InLCA5NzUxNzc3MSwgLh4A8PWSAvkCIThULS10d2kyLUx3S0VNdUJ3QzRZQUNDYzhWc3dBRGdBUUFSSTdVaFE2ZEduQmxnQVlOVUVhQUJ3REhnVWdBRWVpQUVVa0FFQW1BRUFvQUVCcUFFRHNBRUF1UUh6cldxa0FBQVVRTUVCODYxcXBBQUFGRURKQWF2QkkxYUpHLVlfMlFFQUFBQUFBQUR3UC1BQkFQVUJBQUFBQUpnQ0FLQUNBTFVDQUFBQUFMMENBQUFBQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEdHZpOENyb0RDVk5KVGpNNk5EY3pOLUFEcWlPSUJBQ1FCQUNZQkFIQkIFRQkBCHlRUQkJAQEUTmdFQVBFEY0sQUFBQ0lCWUVscVFVAQ0JoAg3RUYBCgkBCERCQh0_AHkVKAxBQUFOMigAAFouKABINEFXZ3doNC6aAokBITZRNmJfUTZ9ASRuUEZiSUFRb0FEFYxUVVFEb0pVMGxPTXpvME56TTNRS29qUxF9DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQzwUmVBQS7CAj9odHRwOi8vcHJlYmlkLm9yZy9kZXYtZG9jcy9zaG93LXZpZGVvLXdpdGgtYS1kZnAtdmlkZW8tdGFnLmh0bWzYAgDgAq2YSOoCSmh0PkoAIGV4YW1wbGVzLwVFaC9pbnN0cmVhbS9mbG93cGxheWVyL3BiLXZlLRkRBVXIgAMAiAMBkAMAmAMXoAMBqgMAwAPgqAHIAwDYAwDgAwDoAwD4AwGABACSBA0vdXQvdjMvCcDwYZgEAKIEDTIwNi4xMjcuMTUuMzeoBL6KC7IEEggBEAQYgAUg6AIoASgCMAA4A7gEAMAEAMgEANIEDjkzMjUjU0lOMzo0NzM32gQCCAHgBADwBMuBwC6IBQGYBQCgBf______AQMUAcAFAMkFaeUU8D_SBQkJCQx4AADYBQHgBQHwBcOVC_oFBAgAEACQBgGYBgC4BgDBBgklKPA_0Ab1L9oGFgoQCREZAVwQABgA4AYE8gYCCACABwGIBwCgB0C6Bw4BSEQYACAAMAA4DEAAyAePuAXSBw0VdTAQABgA2gcGCAAQABgA\u0026s\u003d4558694ec5efa8eff9c58b7529eadca076589bb5]]\u003e\u003c/Impression\u003e\u003cCreatives\u003e\u003cCreative id\u003d\"17\" adID\u003d\"97517771\"\u003e\u003cLinear\u003e\u003cDuration\u003e00:00:30.000\u003c/Duration\u003e\u003cTrackingEvents\u003e\u003cTracking event\u003d\"start\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d2]]\u003e\u003c/Tracking\u003e\u003cTracking event\u003d\"skip\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d3]]\u003e\u003c/Tracking\u003e\u003cTracking event\u003d\"firstQuartile\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d5]]\u003e\u003c/Tracking\u003e\u003cTracking event\u003d\"midpoint\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d6]]\u003e\u003c/Tracking\u003e\u003cTracking event\u003d\"thirdQuartile\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d7]]\u003e\u003c/Tracking\u003e\u003cTracking event\u003d\"complete\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/vast_track/v2?info\u003daAAAAAMArgAFAQlB1BlfAAAAABFyzDtxXx3CFxk1OgRfAAAAACDLgcAuKAAw7Ug47UhA0-hISLuv1AFQ6dGnBljDlQtiAkFFaAFwAXgAgAECiAEBkAGABZgB6AKgAQCoAcuBwC6wAQE.\u0026s\u003d8b0485c35b2a7a6065de23e251e578fcd7b1c485\u0026event_type\u003d8]]\u003e\u003c/Tracking\u003e\u003c/TrackingEvents\u003e\u003cAdParameters\u003e\u003c![CDATA[{\"ads\":[{\"content_source\":\"rtb\",\"buyer_member_id\":9325,\"usersync_url\":\"https%3A%2F%2Facdn.adnxs.com%2Fdmp%2Fasync_usersync.html\",\"viewability\":{\"config\":\"tv\u003dvh2-124\u0026d\u003d1x1\u0026s\u003d3479483\u0026st\u003d0\u0026vctx\u003d1\u0026ts\u003d1594112565\u0026vc\u003diab;vid_ccr\u003d1\u0026vjs\u003dhttps%3A%2F%2Fcdn.adnxs.com%2Fv%2Fvideo%2F191%2Ftrk.js\u0026cb\u003dhttps%3A%2F%2Fsin3-ib.adnxs.com%2Fvevent%3Fan_audit%3D0%26referrer%3Dhttp%253A%252F%252Fprebid.org%252Fexamples%252Fvideo%252Finstream%252Fflowplayer%252Fpb-ve-flowplayer.html%26e%3DwqT_3QLGCaDGBAAAAwDWAAUBCLX0kPgFEPKY74n3q4fhFxitveaB25XZkx8qNgkAAAECCBRAEQEHNAAAFEAZAAAA4HoUFEAhERIAKREJADERG6gw6dGnBjjtSEDtSEgCUMuBwC5YnPFbYABozbp1eI-4BYABAYoBA1VTRJIBAQbwUpgBAaABAagBAbABALgBA8ABBMgBAtABANgBAOABAPABAIoCO3VmKCdhJywgMjUyOTg4NSwgMTU5NDExMjU2NSk7dWYoJ3InLCA5NzUxNzc3MSwgLh4A8PWSAvkCIThULS10d2kyLUx3S0VNdUJ3QzRZQUNDYzhWc3dBRGdBUUFSSTdVaFE2ZEduQmxnQV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u003d0\u0026cecb\u003d\u0026rdcb\u003dhttps%3A%2F%2Fsin3-ib.adnxs.com%2Frd_log%3Fan_audit%3D0%26referrer%3Dhttp%253A%252F%252Fprebid.org%252Fexamples%252Fvideo%252Finstream%252Fflowplayer%252Fpb-ve-flowplayer.html%26e%3DwqT_3QLNC6DNBQAAAwDWAAUBCLX0kPgFEPKY74n3q4fhFxitveaB25XZkx8qNgkAAAECCBRAEQEHNAAAFEAZAAAA4HoUFEAhERIAKREJADERG6gw6dGnBjjtSEDtSEgCUMuBwC5YnPFbYABozbp1eI-4BYABAYoBA1VTRJIBAQbwUpgBAaABAagBAbABALgBA8ABBMgBAtABANgBAOABAPABAIoCO3VmKCdhJywgMjUyOTg4NSwgMTU5NDExMjU2NSk7dWYoJ3InLCA5NzUxNzc3MSwgLh4A8PWSAvkCIThULS10d2kyLUx3S0VNdUJ3QzRZQUNDYzhWc3dBRGdBUUFSSTdVaFE2ZEduQmxnQVlOVUVhQUJ3REhnVWdBRWVpQUVVa0FFQW1BRUFvQUVCcUFFRHNBRUF1UUh6cldxa0FBQVVRTUVCODYxcXBBQUFGRURKQWF2QkkxYUpHLVlfMlFFQUFBQUFBQUR3UC1BQkFQVUJBQUFBQUpnQ0FLQUNBTFVDQUFBQUFMMENBQUFBQU9BQ0FPZ0NBUGdDQUlBREFaZ0RBYWdEdHZpOENyb0RDVk5KVGpNNk5EY3pOLUFEcWlPSUJBQ1FCQUNZQkFIQkIFRQkBCHlRUQkJAQEUTmdFQVBFEY0sQUFBQ0lCWUVscVFVAQ0JoAg3RUYBCgkBCERCQh0_AHkVKAxBQUFOMigAAFouKABINEFXZ3doNC6aAokBITZRNmJfUTZ9ASRuUEZiSUFRb0FEFYxUVVFEb0pVMGxPTXpvME56TTNRS29qUxF9DFBBX1URDAxBQUFXHQwAWR0MAGEdDABjHQzwUmVBQS7CAj9odHRwOi8vcHJlYmlkLm9yZy9kZXYtZG9jcy9zaG93LXZpZGVvLXdpdGgtYS1kZnAtdmlkZW8tdGFnLmh0bWzYAgDgAq2YSOoCSmh0PkoAIGV4YW1wbGVzLwVFaC9pbnN0cmVhbS9mbG93cGxheWVyL3BiLXZlLRkRBVU08gIRCgZBRFZfSUQSBzJJ4QUUCENQRwUUGDU3NTkzNjQBFAgFQ1ABEzQIMjE5Njk5NzTyAg4KCAE8aEZSRVESAjE18gINCghSRU1fVVNFUhIBMPICDAkhFENPREUSAAUPAVgRDxALCgdDUBUOEAkKBUlPAWEEAPIBGgRJTxUaOBMKD0NVU1RPTV9NT0RFTA0kCBoKFjIWABxMRUFGX05BTQVqCB4KGjYdAAhBU1QBPhBJRklFRAFiHA0KCFNQTElUAU3QATCAAwCIAwGQAwCYAxegAwGqAwDAA-CoAcgDANgDAOADAOgDAPgDAYAEAJIEDS91dC92My8px_BhmAQAogQNMjA2LjEyNy4xNS4zN6gEvooLsgQSCAEQBBiABSDoAigBKAIwADgDuAQAwAQAyAQA0gQOOTMyNSNTSU4zOjQ3MzfaBAIIAeAEAPAEy4HALogFAZgFAKAF______8BAxQBwAUAyQWJ7BTwP9IFCQkJDHgAANgFAeAFAfAFw5UL-gUECAAQAJAGAZgGALgGAMEGCSUo8D_QBvUv2gYWChAJERkBXBAAGADgBgTyBgIIAIAHAYgHAKAHQLoHDgFIRBgAIAAwADgMQADIB4-4BdIHDRV1MBAAGADaBwYIABAAGAA.%26s%3D9e2404eaf6ceeecf106233f444c01a133e002466\u0026bridge\u003d1.11.0\u0026rblog\u003dauc\u003d1711963104113052786;bm\u003d9325;sm\u003d9325;cr\u003d97517771;pl\u003d13232361\u0026vid_context\u003danoutstream;anbannerstream;anoverlayplayer\"},\"rtb\":{\"content_b64\":\"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9InllcyI_PjxWQVNUIHZlcnNpb249IjMuMCI-PEFkIGlkPSI5NzUxNzc3MSI-PEluTGluZT48QWRTeXN0ZW0-YWRueHM8L0FkU3lzdGVtPjxBZFRp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2OCIgaGVpZ2h0PSI0MzIiIHNjYWxhYmxlPSJ0cnVlIiBiaXRyYXRlPSIxNTAwIiBtYWludGFpbkFzcGVjdFJhdGlvPSJ0cnVlIj48IVtDREFUQVtodHRwczovL3ZjZG4uYWRueHMuY29tL3AvY3JlYXRpdmUtdmlkZW8vYzcvODQvNDcvZjgvYzc4NDQ3ZjgtODRmNy00MDBiLWFhY2YtMzlhODdkOWUxZmI3L2M3ODQ0N2Y4LTg0ZjctNDAwYi1hYWNmLTM5YTg3ZDllMWZiN183NjhfNDMyXzE1MDBrLndlYm1dXT48L01lZGlhRmlsZT48TWVkaWFGaWxlIGlkPSI4MjQ2NTQiIGRlbGl2ZXJ5PSJwcm9ncmVzc2l2ZSIgdHlwZT0idmlkZW8vbXA0IiB3aWR0aD0iOTYwIiBoZWlnaHQ9IjU0MCIgc2NhbGFibGU9InRydWUiIGJpdHJhdGU9IjE3NzUiIG1haW50YWluQXNwZWN0UmF0aW89InRydWUiPjwhW0NEQVRBW2h0dHBzOi8vdmNkbi5hZG54cy5jb20vcC9jcmVhdGl2ZS12aWRlby9jNy84NC80Ny9mOC9jNzg0NDdmOC04NGY3LTQwMGItYWFjZi0zOWE4N2Q5ZTFmYjcvYzc4NDQ3ZjgtODRmNy00MDBiLWFhY2YtMzlhODdkOWUxZmI3Lm1wNF1dPjwvTWVkaWFGaWxlPjwvTWVkaWFGaWxlcz48L0xpbmVhcj48L0NyZWF0aXZlPjwvQ3JlYXRpdmVzPjwvSW5MaW5lPjwvQWQ-PC9WQVNUPg..\"}}]}]]\u003e\u003c/AdParameters\u003e\u003cVideoClicks\u003e\u003cClickThrough\u003e\u003c![CDATA[http://prebid.org/dev-docs/show-video-with-a-dfp-video-tag.html]]\u003e\u003c/ClickThrough\u003e\u003cClickTracking id\u003d\"adnxs\"\u003e\u003c![CDATA[https://sin3-ib.adnxs.com/click?AAAAAAAAFEAAAAAAAAAUQAAAAOB6FBRAAAAAAAAAFEAAAAAAAAAUQHLMO3FfHcIXrZ45sK1kJx81OgRfAAAAAOnoyQBtJAAAbSQAAAIAAADLANAFnPgWAAAAAABVU0QAVVNEAAEAAQBNXQAAAAABAwQCAAAAALoA_xT_dgAAAAA./bcr\u003dAAAAAAAA8D8\u003d/cnd\u003d%216Q6b_Qi2-LwKEMuBwC4YnPFbIAQoADEAAAAAAAAUQDoJU0lOMzo0NzM3QKojSQAAAAAAAPA_UQAAAAAAAAAAWQAAAAAAAAAAYQAAAAAAAAAAaQAAAAAAAAAAcQAAAAAAAAAAeAA./cca\u003dOTMyNSNTSU4zOjQ3Mzc\u003d/bn\u003d89103/]]\u003e\u003c/ClickTracking\u003e\u003c/VideoClicks\u003e\u003cMediaFiles\u003e\u003cMediaFile id\u003d\"16\" delivery\u003d\"progressive\" type\u003d\"application/javascript\" width\u003d\"640\" height\u003d\"360\" scalable\u003d\"true\" maintainAspectRatio\u003d\"true\" apiFramework\u003d\"VPAID\"\u003e\u003c![CDATA[https://acdn.adnxs.com/vx/static/w/anwrapper-1.910.0.js]]\u003e\u003c/MediaFile\u003e\u003c/MediaFiles\u003e\u003c/Linear\u003e\u003c/Creative\u003e\u003c/Creatives\u003e\u003c/InLine\u003e\u003c/Ad\u003e\u003c/VAST\u003e",
		"currency": "USD",
		"dfp_id": "video1",
		"mediaType": "video"
	}]
}

sample curl call to https://prebid.media.net/rtb/prebid

curl 'https://prebid.media.net/rtb/prebid?cid=8CUX0H51C' \
  -H 'authority: prebid.media.net' \
  -H 'pragma: no-cache' \
  -H 'cache-control: no-cache' \
  -H 'user-agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' \
  -H 'dnt: 1' \
  -H 'content-type: text/plain' \
  -H 'accept: */*' \
  -H 'origin: http://localhost:63342' \
  -H 'sec-fetch-site: cross-site' \
  -H 'sec-fetch-mode: cors' \
  -H 'sec-fetch-dest: empty' \
  -H 'referer: http://localhost:63342/Prebid.js/instream.html?_ijt=ce2v606e5938bap56qpt298s4k' \
  -H 'accept-language: en-US,en;q=0.9,hi;q=0.8,ms;q=0.7' \
  -H 'cookie: gdpr_status=1' \
  --data-binary '{"site":{"domain":"smoketesting.net","page":"http://smoketesting.net/prebidtest/","ref":"http://smoketesting.net/prebidtest/","isTop":true},"ext":{"customer_id":"8CUX0H51C","prebid_version":"v3.25.0-pre","gdpr_applies":false,"usp_applies":false,"coppa_applies":false,"screen":{"w":775,"h":792}},"id":"cae7aed1-1a06-4dc6-b6e3-2024d3745a41","imp":[{"id":"283edb14e445b","ext":{"dfp_id":"video1","display_count":1,"visibility":0},"all":{"cid":"8CUX0H51C","video":{"mimes":["video/mp4"],"placement":1},"site":{"page":"http://smoketesting.net/prebidtest/","domain":"smoketesting.net","ref":"http://smoketesting.net/prebidtest/"}},"video":{"context":"instream","playerSize":[[640,480]],"mimes":["video/mp4"],"placement":1}}],"tmax":3000}' \
  --compressed

Following is my sample test page

<html>
<head>
    <script type="text/javascript" src="build/dev/prebid.js" async></script>
    <link rel="stylesheet" href="//cdn.flowplayer.com/releases/native/stable/style/flowplayer.css">
    <script src="//cdn.flowplayer.com/releases/native/stable/flowplayer.min.js"></script>
    <script src="//cdn.flowplayer.com/releases/native/stable/plugins/ads.min.js"></script>
    <script src="//imasdk.googleapis.com/js/sdkloader/ima3.js"></script>
    <style>
        #player {
            max-width: 40em;
            width: 100%;
            float: left;
        }

        #controls {
            float: left;
            padding: 1em;
        }
    </style>
    <script>
      var pbjs = pbjs || {};
      pbjs.que = pbjs.que || [];

      // The ad tag in Flowplayer can be actual ad tag or promise to an ad tag.
      // We return the ad tag if it is available before the player is ready to play
      // Otherwise the player waits for 2 secs for tag to be available.

      var adtag = null
      var timeout = 20000
      var asyncTag = function() {
        if (adtag) return Promise.resolve(adtag)

        return new Promise(function (resolve) {
          setTimeout(function() {
            resolve(adtag)
          }, timeout)
        })
      }

      /*
       Prebid Video adUnit
       */

      var videoAdUnit = {
        code: 'video1',
        mediaTypes: {
          video: {
            context: "instream",
            playerSize: [640, 480]
          }
        },
        bids: [{
          bidder: 'medianet',
          params: {
            cid: '8CUX0H51C',
            video: {
              mimes: ['video/mp4'],
              placement: 1
            },
            // Site member is to be used only for testing
            site: {
              page: 'http://smoketesting.net/prebidtest/',
              domain: 'smoketesting.net',
              ref: 'http://smoketesting.net/prebidtest/'
            }
          }
        }]
      };

      pbjs.que.push(function(){
        pbjs.addAdUnits(videoAdUnit); 


        pbjs.setConfig({
          debug: true,
          cache: {
            url: 'https://prebid.adnxs.com/pbc/v1/cache'
          }
        });

        pbjs.requestBids({
          bidsBackHandler: function(bids) {

            var videoUrl = pbjs.adServers.dfp.buildVideoUrl({
              adUnit: videoAdUnit,
              params: {
                iu: '/45361917/Managed_Prebid_Video_Adunit_1',
                cust_params: {
                  section: "blog",
                  anotherKey: "anotherValue"
                },
                output: "vast"
              }
            });
            adtag = videoUrl;
          }
        });
      });

    </script>
</head>

<body>
<div id="player"></div>
<!--video player div-->
<div id="player"></div>
<div id="controls">
    <button id="ad-toggle" disabled>
        Toggle ad playback
    </button>
    <p>The button will be enabled only during ads</p>
</div>

<script type="text/javascript">
  var player = flowplayer('#player', {
    src: "//edge.flowplayer.org/drive.mp4",
    title: "Flowplayer demo",
    description: "Demo showing ads",
    autoplay: true,
    ima: {
      ads: [
        {"time":30,"adTag":asyncTag}
      ]
    },
    token:"eyJraWQiOiJZSVI0VVJZODA2TGoiLCJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJjIjoie1wiYWNsXCI6NixcImlkXCI6XCJZSVI0VVJZODA2TGpcIn0iLCJpc3MiOiJGbG93cGxheWVyIn0.YUoY8b2vl1Z15PikwgYeWQ8Cp85C-TvtmwIJ_UFxpfAYYH8yiiUrhmd3SaY_qb3AvVDz45xVV6R9wizYl-NRGQ"
  })

  var btn = document.querySelector('#ad-toggle');

  btn.addEventListener('click', function() {
    if (player.ads.adPlaying) player.ads.pause();
    else player.ads.resume();
  })

  function toggleDisabled(disabled) {
    return function() { btn.disabled = disabled }
  }

  player.ads.on(flowplayer.AdEvents.AD_STARTED, toggleDisabled(false));
  player.ads.on(flowplayer.AdEvents.AD_COMPLETED, toggleDisabled(true));
  player.ads.on(flowplayer.AdEvents.AD_SKIPPED, toggleDisabled(true));

</script>

</body>
</html>

@Fawke
Copy link
Contributor

Fawke commented Jul 28, 2020

@c3p-0, Thanks for sharing the test page, am able to get a bid response. Last thing, just make a small modification to accept video params from both bidder.paramsOR video.mediaType. The code change will be in medianetBidAdapter.js file, specifically the way you read video params. Give more precedence to mediaTypes.video in case both bidder.params.video and mediaTypes.video exists.

A publisher should be able to configure the adUnit like this as well:

{
  code: ...
  mediaTypes: {
    video: {
      context: 'instream',
      playerSize: [640, 480],
      mimes: ['video/mp4'],
      minduration: 1,
      maxduration: 2,
      protocols: [1, 2],
      w: 1,
      h: 2,
      startdelay: 1,
      placement: 1,
      playbackmethod: [2]
      // other OpenRTB video params
    }
  }
  bids: [{...}]
}

@c3p-0
Copy link
Contributor Author

c3p-0 commented Jul 28, 2020

@Fawke Thanks for your quick response. I have incorporated all of the changes. Please have a look.

Copy link
Contributor

@Fawke Fawke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@c3p-0 Thanks for making the changes.

@Fawke Fawke added LGTM and removed needs update labels Jul 29, 2020
@Fawke Fawke merged commit f9631fb into prebid:master Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants