public override void processEvent(Event @event) { Video video = (Video)@event.properties.get(Event.VIDEO); IAdContext adContext = (IAdContext)@event.properties.get(FreeWheelController.AD_CONTEXT_KEY); IConstants adConstants = adContext.Constants; // This overrides what the plugin does by default for setVideoAsset() which is to pass in currentVideo.getId(). adContext.setVideoAsset("3pqa_video", video.Duration / 1000, null, adConstants.VIDEO_ASSET_AUTO_PLAY_TYPE_ATTENDED(), (int)Math.Floor(new Random(1).NextDouble() * int.MaxValue), 0, adConstants.ID_TYPE_CUSTOM(), 0, adConstants.VIDEO_ASSET_DURATION_TYPE_EXACT()); // duration type - fallback ID - type of video ID passed (customer created or FW issued) - setting networkId for 0 as it's the default value for this method - a random number - auto play type - location - FW uses their duration as seconds; Android is in milliseconds - video ID adContext.addSiteSectionNonTemporalSlot("300x250slot", null, 300, 250, null, true, null, null); // Add preroll Log.v(outerInstance.TAG, "Adding temporal slot for prerolls"); adContext.addTemporalSlot("larry", "PREROLL", 0, null, 0, 0, null, null, 0); // Add midroll Log.v(outerInstance.TAG, "Adding temporal slot for midrolls"); int midrollCount = 1; int segmentLength = (video.Duration / 1000) / (midrollCount + 1); for (int i = 0; i < midrollCount; i++) { adContext.addTemporalSlot("moe" + i, "MIDROLL", segmentLength * (i + 1), null, 0, 0, null, null, 0); } // Add postroll Log.v(outerInstance.TAG, "Adding temporal slot for postrolls"); adContext.addTemporalSlot("curly", "POSTROLL", video.Duration / 1000, null, 0, 0, null, null, 0); // Add overlay Log.v(outerInstance.TAG, "Adding temporal slot for overlays"); adContext.addTemporalSlot("shemp", "OVERLAY", 8, null, 0, 0, null, null, 0); }