use of org.prebid.mobile.rendering.models.openrtb.bidRequests.imps.Video in project prebid-mobile-android by prebid.
the class BasicParameterBuilderTest method getExpectedVideoImpValues.
private Video getExpectedVideoImpValues(Imp imp, AdConfiguration adConfiguration) {
Video video = new Video();
// Common values for all video reqs
video.mimes = BasicParameterBuilder.SUPPORTED_VIDEO_MIME_TYPES;
video.protocols = BasicParameterBuilder.SUPPORTED_VIDEO_PROTOCOLS;
video.linearity = BasicParameterBuilder.VIDEO_LINEARITY_LINEAR;
// Interstitial video specific values
// On Leaving Viewport or when Terminated by User
video.playbackend = VIDEO_INTERSTITIAL_PLAYBACK_END;
video.delivery = new int[] { BasicParameterBuilder.VIDEO_DELIVERY_DOWNLOAD };
video.pos = AdPosition.FULLSCREEN.getValue();
if (!adConfiguration.isPlacementTypeValid()) {
video.placement = VIDEO_INTERSTITIAL_PLACEMENT;
Configuration deviceConfiguration = mContext.getResources().getConfiguration();
video.w = deviceConfiguration.screenWidthDp;
video.h = deviceConfiguration.screenHeightDp;
} else {
video.placement = adConfiguration.getPlacementTypeValue();
for (AdSize size : adConfiguration.getAdSizes()) {
video.w = size.width;
video.h = size.height;
break;
}
}
return video;
}
use of org.prebid.mobile.rendering.models.openrtb.bidRequests.imps.Video in project prebid-mobile-android by prebid.
the class ImpTest method getJsonObject.
@Test
public void getJsonObject() throws Exception {
Imp imp = new Imp();
imp.displaymanager = "prebid";
imp.displaymanagerver = "1.0";
imp.instl = 1;
imp.tagid = "tagid";
imp.secure = 0;
imp.banner = new Banner();
imp.video = new Video();
imp.pmp = new Pmp();
imp.clickBrowser = 0;
JSONObject actualObj = imp.getJsonObject();
String expectedString = "{\"clickbrowser\":0,\"pmp\":{},\"tagid\":\"tagid\",\"displaymanager\":\"prebid\",\"displaymanagerver\":\"1.0\",\"banner\":{},\"video\":{},\"secure\":0,\"instl\":1}";
assertEquals("got: " + actualObj.toString(), expectedString, actualObj.toString());
imp.getJsonObject();
}
use of org.prebid.mobile.rendering.models.openrtb.bidRequests.imps.Video in project prebid-mobile-android by prebid.
the class BasicParameterBuilder method setVideoImpValues.
private void setVideoImpValues(Imp imp) {
Video video = new Video();
// Common values for all video reqs
video.mimes = SUPPORTED_VIDEO_MIME_TYPES;
video.protocols = SUPPORTED_VIDEO_PROTOCOLS;
video.linearity = VIDEO_LINEARITY_LINEAR;
// Interstitial video specific values
// On Leaving Viewport or when Terminated by User
video.playbackend = VIDEO_INTERSTITIAL_PLAYBACK_END;
video.delivery = new int[] { VIDEO_DELIVERY_DOWNLOAD };
if (mAdConfiguration.isAdPositionValid()) {
video.pos = mAdConfiguration.getAdPositionValue();
}
if (!mAdConfiguration.isPlacementTypeValid()) {
video.placement = PlacementType.INTERSTITIAL.getValue();
if (mResources != null) {
Configuration deviceConfiguration = mResources.getConfiguration();
video.w = deviceConfiguration.screenWidthDp;
video.h = deviceConfiguration.screenHeightDp;
}
} else {
video.placement = mAdConfiguration.getPlacementTypeValue();
for (AdSize size : mAdConfiguration.getAdSizes()) {
video.w = size.width;
video.h = size.height;
break;
}
}
imp.video = video;
}
Aggregations