Skip to content

Commit

Permalink
build: use renamed API in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjl-mux committed Oct 29, 2024
1 parent 20b4c64 commit 554dac7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Example/DemoApp/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class ViewController: UIViewController, IMAAdsLoaderDelegate, IMAAdsManagerDeleg
private var contentPlayhead: IMAAVPlayerContentPlayhead?

// Mux SDK
private var imaListener: MuxImaListener?
private var adsListener: MUXSDKIMAAdsListener?
private var playerBinding: MUXSDKPlayerBinding?


Expand Down Expand Up @@ -92,7 +92,7 @@ class ViewController: UIViewController, IMAAdsLoaderDelegate, IMAAdsManagerDeleg
self.playerBinding = playerBinding

// IMA Ads
imaListener = MuxImaListener(
adsListener = MUXSDKIMAAdsListener(
playerBinding: playerBinding,
monitoringAdsLoader: adsLoader
)
Expand Down Expand Up @@ -125,7 +125,7 @@ class ViewController: UIViewController, IMAAdsLoaderDelegate, IMAAdsManagerDeleg
userContext: nil)

// MARK: mux - Tell us when you first request CSAI ads
imaListener?.clientAdRequest(request)
adsListener?.clientAdRequest(request)
adsLoader.requestAds(with: request)
}

Expand All @@ -150,7 +150,7 @@ class ViewController: UIViewController, IMAAdsLoaderDelegate, IMAAdsManagerDeleg
adsManager.delegate = self

//MARK: mux: Call before initialize() but after setting your IMAAdsManagerDelegate
imaListener?.monitorAdsManager(adsManager)
adsListener?.monitorAdsManager(adsManager)

adsManager.initialize(with: nil)
}
Expand Down
4 changes: 2 additions & 2 deletions Example/MUXSDKIMATVOSExample/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ViewController: UIViewController, IMAAdsLoaderDelegate, IMAAdsManagerDeleg
var playerViewController: AVPlayerViewController!
var adBreakActive = false
var playerBinding: MUXSDKPlayerBinding?
var imaListener: MuxImaListener?
var imaListener: MUXSDKIMAAdsListener?

deinit {
NotificationCenter.default.removeObserver(self)
Expand Down Expand Up @@ -181,7 +181,7 @@ extension ViewController {
self.playerBinding = playerBinding

// IMA Ads
imaListener = MuxImaListener(playerBinding: playerBinding)
imaListener = MUXSDKIMAAdsListener(playerBinding: playerBinding)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PlayerContainerViewController: UIViewController {
)
lazy var playerViewController = AVPlayerViewController()

var imaListener: MuxImaListener?
var adsListener: MUXSDKIMAAdsListener?

// MARK: View controller lifecycle

Expand Down Expand Up @@ -87,14 +87,15 @@ class PlayerContainerViewController: UIViewController {
}

// MARK: Setup Mux Data IMA Plugin
imaListener = MuxImaListener(
adsListener = MUXSDKIMAAdsListener(
playerBinding: playerBinding,
monitoringAdsLoader: adsLoader
)
}

override func viewWillAppear() {
showContentPlayer()

override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
showContentPlayer()
}

// MARK: Show and hide content player
Expand Down Expand Up @@ -145,7 +146,7 @@ class PlayerContainerViewController: UIViewController {
adsLoader.requestAds(with: request)

// Notify Mux Data about request
imaListener?.clientAdRequest(request)
adsListener?.clientAdRequest(request)
}

// MARK: deinit
Expand All @@ -170,7 +171,7 @@ extension PlayerContainerViewController: IMAAdsLoaderDelegate {

// MARK: Monitor the IMAAdsManager with Mux
// note - do this *after* setting your delegate but *before*
imaListener?.monitorAdsManager(loadedAdsManager)
adsListener?.monitorAdsManager(loadedAdsManager)

let renderingSettings = IMAAdsRenderingSettings()
renderingSettings.enablePreloading = true;
Expand Down

0 comments on commit 554dac7

Please sign in to comment.