From 524360dd4e4cb4987456312b82b495cfe637a29b Mon Sep 17 00:00:00 2001 From: Olena Stepaniuk Date: Thu, 4 Jan 2024 13:03:34 +0200 Subject: [PATCH] fix: instream video examples --- .../GAMOriginalAPIVideoInstreamViewController.m | 8 ++++---- .../GAMOriginalAPIVideoInstreamViewController.swift | 8 ++++---- .../Model/TestCasesManager.swift | 4 ++-- .../PrebidOriginalAPIVideoInstreamViewController.swift | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Example/PrebidDemo/PrebidDemoObjectiveC/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.m b/Example/PrebidDemo/PrebidDemoObjectiveC/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.m index 9796f45dd..b462e50dd 100644 --- a/Example/PrebidDemo/PrebidDemoObjectiveC/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.m +++ b/Example/PrebidDemo/PrebidDemoObjectiveC/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.m @@ -19,8 +19,8 @@ @import PrebidMobile; NSString * const videoContentURL = @"https://storage.googleapis.com/gvabox/media/samples/stock.mp4"; -NSString * const storedImpVideo = @"prebid-demo-video-interstitial-320-480"; -NSString * const gamAdUnitVideo = @"/21808260008/prebid_oxb_interstitial_video"; +NSString * const storedImpVideo = @"prebid-demo-video-interstitial-320-480-original-api"; +NSString * const gamAdUnitVideo = @"/21808260008/prebid_demo_app_instream"; @interface GAMOriginalAPIVideoInstreamViewController () @@ -90,7 +90,7 @@ - (void)onPlayButtonPressed:(id)sender { - (void)createAd { // 1. Create InstreamVideoAdUnit - self.adUnit = [[InstreamVideoAdUnit alloc] initWithConfigId:storedImpVideo size:self.adSize]; + self.adUnit = [[InstreamVideoAdUnit alloc] initWithConfigId:storedImpVideo size:CGSizeMake(640, 480)]; // 2. Configure Video Parameters VideoParameters * parameters = [[VideoParameters alloc] initWithMimes:@[@"video/mp4"]]; @@ -112,7 +112,7 @@ - (void)createAd { @try { // 5. Generate GAM Instream URI - NSString * adServerTag = [IMAUtils.shared generateInstreamUriForGAMWithAdUnitID:gamAdUnitVideo adSlotSizes:@[IMAAdSlotSize.Size320x480] customKeywords:prebidKeys error:nil]; + NSString * adServerTag = [IMAUtils.shared generateInstreamUriForGAMWithAdUnitID:gamAdUnitVideo adSlotSizes:@[IMAAdSlotSize.Size640x480] customKeywords:prebidKeys error:nil]; // 6. Load IMA ad request IMAAdDisplayContainer * adDisplayContainer = [[IMAAdDisplayContainer alloc] initWithAdContainer:self.instreamView viewController:self]; diff --git a/Example/PrebidDemo/PrebidDemoSwift/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.swift b/Example/PrebidDemo/PrebidDemoSwift/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.swift index b0a10a908..56fedd4cb 100644 --- a/Example/PrebidDemo/PrebidDemoSwift/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.swift +++ b/Example/PrebidDemo/PrebidDemoSwift/Examples/GAM/OriginalAPI/GAMOriginalAPIVideoInstreamViewController.swift @@ -18,8 +18,8 @@ import PrebidMobile import GoogleInteractiveMediaAds fileprivate let videoContentURL = "https://storage.googleapis.com/gvabox/media/samples/stock.mp4" -fileprivate let storedImpVideo = "prebid-demo-video-interstitial-320-480" -fileprivate let gamAdUnitVideo = "/21808260008/prebid_oxb_interstitial_video" +fileprivate let storedImpVideo = "prebid-demo-video-interstitial-320-480-original-api" +fileprivate let gamAdUnitVideo = "/21808260008/prebid_demo_app_instream" class GAMOriginalAPIVideoInstreamViewController: InstreamBaseViewController, @@ -89,7 +89,7 @@ class GAMOriginalAPIVideoInstreamViewController: func createAd() { // 1. Create InstreamVideoAdUnit - adUnit = InstreamVideoAdUnit(configId: storedImpVideo, size: CGSize(width: 1,height: 1)) + adUnit = InstreamVideoAdUnit(configId: storedImpVideo, size: CGSize(width: 640, height: 480)) // 2. Configure Video Parameters let parameters = VideoParameters(mimes: ["video/mp4"]) @@ -108,7 +108,7 @@ class GAMOriginalAPIVideoInstreamViewController: do { // 5. Generate GAM Instream URI - let adServerTag = try IMAUtils.shared.generateInstreamUriForGAM(adUnitID: gamAdUnitVideo, adSlotSizes: [.Size320x480], customKeywords: prebidKeys!) + let adServerTag = try IMAUtils.shared.generateInstreamUriForGAM(adUnitID: gamAdUnitVideo, adSlotSizes: [.Size640x480], customKeywords: prebidKeys!) // 6. Load IMA ad request let adDisplayContainer = IMAAdDisplayContainer(adContainer: self.instreamView, viewController: self) diff --git a/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift b/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift index c0f9b640b..6083d3e60 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift +++ b/InternalTestApp/PrebidMobileDemoRendering/Model/TestCasesManager.swift @@ -522,8 +522,8 @@ struct TestCaseManager { let instreamController = PrebidOriginalAPIVideoInstreamViewController(rootController: adapterVC) instreamController.videoContentURL = "https://storage.googleapis.com/gvabox/media/samples/stock.mp4" - instreamController.prebidConfigId = "prebid-ita-video-interstitial-320-480" - instreamController.gamAdUnitVideo = "/21808260008/prebid_oxb_interstitial_video" + instreamController.prebidConfigId = "prebid-demo-video-interstitial-320-480-original-api" + instreamController.gamAdUnitVideo = "/21808260008/prebid_demo_app_instream" adapterVC.setup(adapter: instreamController) setupCustomParams(for: instreamController.prebidConfigId) diff --git a/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidOriginalAPIVideoInstreamViewController.swift b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidOriginalAPIVideoInstreamViewController.swift index 2dc85623b..b7e7074ab 100644 --- a/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidOriginalAPIVideoInstreamViewController.swift +++ b/InternalTestApp/PrebidMobileDemoRendering/ViewControllers/Adapters/Prebid/OriginalAPI/PrebidOriginalAPIVideoInstreamViewController.swift @@ -101,7 +101,7 @@ class PrebidOriginalAPIVideoInstreamViewController: name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: contentPlayer?.currentItem) - adUnit = VideoAdUnit(configId: prebidConfigId, size: CGSize(width: 1, height: 1)) + adUnit = VideoAdUnit(configId: prebidConfigId, size: CGSize(width: 640, height: 480)) // imp[].ext.data if let adUnitContext = AppConfiguration.shared.adUnitContext { @@ -158,7 +158,7 @@ class PrebidOriginalAPIVideoInstreamViewController: guard let self = self else { return } if resultCode == .prebidDemandFetchSuccess { do { - let adServerTag = try IMAUtils.shared.generateInstreamUriForGAM(adUnitID: self.gamAdUnitVideo, adSlotSizes: [.Size320x480], customKeywords: prebidKeys!) + let adServerTag = try IMAUtils.shared.generateInstreamUriForGAM(adUnitID: self.gamAdUnitVideo, adSlotSizes: [.Size640x480], customKeywords: prebidKeys!) let adDisplayContainer = IMAAdDisplayContainer(adContainer: self.rootController.bannerView, viewController: self.rootController) let request = IMAAdsRequest(adTagUrl: adServerTag, adDisplayContainer: adDisplayContainer, contentPlayhead: nil, userContext: nil)