-
Notifications
You must be signed in to change notification settings - Fork 893
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ads] Fix NTT video background may be blank after changing NTP media type setting #25285
Conversation
setupBackgroundImage() | ||
|
||
let isTabVisible = viewIfLoaded?.window != nil | ||
setupBackgroundVideoIfNeeded(shouldCreatePlayer: isTabVisible) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is a proper place to call setupBackgroundVideoIfNeeded
after background is changed (which happens when user changes New Tab Page
setting)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need to create AVPlayer object only if current tab is visible to avoid memory/processor consumption.
AVPlayer object will be created during willMove(...)
when user switches to tab.
else { | ||
guard let backgroundVideoPath = background.backgroundVideoPath else { | ||
videoPlayer = nil | ||
backgroundView.resetPlayerLayer() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to free resources and hide play button when the current NTP is changed from NTT video to image background.
TeamCity build failures are not connected to the current functionality. |
[ads] Fix NTT video background may be blank after changing NTP media type setting
…t to 1.70.x) (#25326) * Merge pull request #25108 from brave/issues/38198 [ads] Add Sponsored Images & Videos option to New Tab Page setting * Merge pull request #25175 from brave/issues/40507 [ads] Add NTP media type p3a metric * Merge pull request #25285 from brave/issues/40605 [ads] Fix NTT video background may be blank after changing NTP media type setting
Resolves brave/brave-browser#40605
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: