Skip to content

Update "Resolves a retain cycle and memory leak involving the RCTVideo instance when using Google IMA ads in react-native-video."#4621

Open
MdAbubakar wants to merge 2 commits intoTheWidlarzGroup:support/6.x.xfrom
MdAbubakar:revert-4574-fixes-RCTVideo-memory-leak
Open

Update "Resolves a retain cycle and memory leak involving the RCTVideo instance when using Google IMA ads in react-native-video."#4621
MdAbubakar wants to merge 2 commits intoTheWidlarzGroup:support/6.x.xfrom
MdAbubakar:revert-4574-fixes-RCTVideo-memory-leak

Conversation

@MdAbubakar
Copy link

Update #4574

iOS Google IMA Ads Container Not Resizing on Fullscreen or Rotation — Fixed by Adding AutoresizingMask

After recent changes to Google IMA integration, the ad container on iOS was not resizing when the player entered/exited fullscreen or changed orientation when using custom controls.

Cause:
The adContainerView added inside requestAds() had a fixed frame without autoresizingMask, causing layout issues.

Fix:
Added:
adContainerView.autoresizingMask = [.flexibleWidth, .flexibleHeight]

let adContainerView = UIView(frame: _video.bounds)
adContainerView.backgroundColor = .clear
adContainerView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
_video.addSubview(adContainerView)

Copy link
Author

@MdAbubakar MdAbubakar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS Google IMA Ads Container Not Resizing on Fullscreen or Rotation — Fixed by Adding AutoresizingMask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To Triage

Development

Successfully merging this pull request may close these issues.

1 participant