Skip to content

Commit

Permalink
defer player setup
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjl-mux committed Nov 6, 2024
1 parent b3c35d0 commit aa067fe
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ class PlayerContainerViewController: UIViewController {

self.view.backgroundColor = UIColor.black
self.view.accessibilityIdentifier = "AVPlayerView"
}

func setupPlayer() {
// MARK: Setup Content Player
playerViewController.player = contentPlayer

Expand All @@ -81,7 +83,7 @@ class PlayerContainerViewController: UIViewController {
adsLoader = IMAAdsLoader(settings: IMASettings())
adsLoader.delegate = self

// MARK: Setup Mux Data
// MARK: Setup Mux Data
let customerPlayerData = MUXSDKCustomerPlayerData()
customerPlayerData.environmentKey = environmentKey

Expand Down Expand Up @@ -121,6 +123,7 @@ class PlayerContainerViewController: UIViewController {
playerName
)
hideContentPlayer()
contentPlayer.replaceCurrentItem(with: nil)
super.viewWillDisappear(animated)
}

Expand All @@ -144,6 +147,7 @@ class PlayerContainerViewController: UIViewController {
// MARK: Handlers

func playButtonPressed() {
setupPlayer()
requestAds()
}

Expand Down

0 comments on commit aa067fe

Please sign in to comment.