Search in sources :

Example 56 with AdConfiguration

use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.

the class VideoCreative method load.

@Override
public void load() {
    // Use URLConnection to download a video file.
    BaseNetworkTask.GetUrlParams params = new BaseNetworkTask.GetUrlParams();
    params.url = mModel.getMediaUrl();
    params.userAgent = AppInfoManager.getUserAgent();
    params.requestType = "GET";
    params.name = BaseNetworkTask.DOWNLOAD_TASK;
    Context context = mContextReference.get();
    if (context != null) {
        AdConfiguration adConfiguration = mModel.getAdConfiguration();
        String shortenedPath = LruController.getShortenedPath(params.url);
        File file = new File(context.getFilesDir(), shortenedPath);
        VideoDownloadTask videoDownloadTask = new VideoDownloadTask(context, file, new VideoCreativeVideoPreloadListener(this), adConfiguration);
        mVideoDownloadTask = videoDownloadTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, params);
    }
}
Also used : Context(android.content.Context) BaseNetworkTask(org.prebid.mobile.rendering.networking.BaseNetworkTask) AdConfiguration(org.prebid.mobile.rendering.models.AdConfiguration) File(java.io.File)

Example 57 with AdConfiguration

use of org.prebid.mobile.rendering.models.AdConfiguration in project prebid-mobile-android by prebid.

the class VideoCreative method createOmAdSession.

@Override
public void createOmAdSession() {
    OmAdSessionManager omAdSessionManager = mWeakOmAdSessionManager.get();
    if (omAdSessionManager == null) {
        LogUtil.error(TAG, "Error creating AdSession. OmAdSessionManager is null");
        return;
    }
    AdConfiguration adConfiguration = mModel.getAdConfiguration();
    ContentObject contentObject = adConfiguration.getAppContent();
    String contentUrl = null;
    if (contentObject != null)
        contentUrl = contentObject.getUrl();
    omAdSessionManager.initVideoAdSession(mModel.getAdVerifications(), contentUrl);
    startOmSession();
}
Also used : OmAdSessionManager(org.prebid.mobile.rendering.session.manager.OmAdSessionManager) AdConfiguration(org.prebid.mobile.rendering.models.AdConfiguration) ContentObject(org.prebid.mobile.ContentObject)

Aggregations

AdConfiguration (org.prebid.mobile.rendering.models.AdConfiguration)57 Test (org.junit.Test)38 BasicParameterBuilder (org.prebid.mobile.rendering.networking.parameters.BasicParameterBuilder)15 AdSize (org.prebid.mobile.rendering.bidding.data.AdSize)13 BidRequest (org.prebid.mobile.rendering.models.openrtb.BidRequest)11 Before (org.junit.Before)8 Imp (org.prebid.mobile.rendering.models.openrtb.bidRequests.Imp)8 Context (android.content.Context)6 JSONObject (org.json.JSONObject)6 BidResponse (org.prebid.mobile.rendering.bidding.data.bid.BidResponse)6 Activity (android.app.Activity)5 AdException (org.prebid.mobile.rendering.errors.AdException)5 AbstractCreative (org.prebid.mobile.rendering.models.AbstractCreative)5 VideoCreativeModel (org.prebid.mobile.rendering.video.VideoCreativeModel)5 AdViewManager (org.prebid.mobile.rendering.views.AdViewManager)5 Handler (android.os.Handler)3 JSONArray (org.json.JSONArray)3 HTMLCreative (org.prebid.mobile.rendering.models.HTMLCreative)3 Ext (org.prebid.mobile.rendering.models.openrtb.bidRequests.Ext)3 User (org.prebid.mobile.rendering.models.openrtb.bidRequests.User)3