Skip to content

Commit

Permalink
fix(ios): fix pip active fn variable reference
Browse files Browse the repository at this point in the history
  • Loading branch information
YangJonghun committed May 17, 2024
1 parent f0647da commit 5459d73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions ios/Video/Features/RCTIMAAdsManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

class RCTIMAAdsManager: NSObject, IMAAdsLoaderDelegate, IMAAdsManagerDelegate, IMALinkOpenerDelegate {
private weak var _video: RCTVideo?
private var _pipEnabled: () -> Bool
private var _pipActive: () -> Bool

/* Entry point for the SDK. Used to make ad requests. */
private var adsLoader: IMAAdsLoader!
/* Main point of interaction with the SDK. Created by the SDK as the result of an ad request. */
private var adsManager: IMAAdsManager!

init(video: RCTVideo!, pipEnabled: @escaping () -> Bool) {
init(video: RCTVideo!, pipActive: @escaping () -> Bool) {
_video = video
_pipEnabled = pipEnabled
_pipActive = pipActive

super.init()
}
Expand Down Expand Up @@ -98,7 +98,7 @@
}
// Play each ad once it has been loaded
if event.type == IMAAdEventType.LOADED {
if _pipEnabled() {
if _pipActive() {
return
}
adsManager.start()
Expand Down
2 changes: 1 addition & 1 deletion ios/Video/RCTVideo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class RCTVideo: UIView, RCTVideoPlayerViewControllerDelegate, RCTPlayerObserverH
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
#if USE_GOOGLE_IMA
_imaAdsManager = RCTIMAAdsManager(video: self, pipEnabled: isPipEnabled)
_imaAdsManager = RCTIMAAdsManager(video: self, pipActive: isPipActive)
#endif
}

Expand Down

0 comments on commit 5459d73

Please sign in to comment.