Skip to content
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

✨[Project Apester] Implement supporting adset data #39814

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

andreyYatskov
Copy link
Contributor

This code is needed for our customers cause new data configuration is implemented.

@erwinmombay erwinmombay requested review from powerivq and erwinmombay and removed request for rbeckthomas February 14, 2024 18:45
apesterElement.appendChild(ampAvAdWrap);

showInUnitAd(ampAvAdWrap, progressBarWrap, refreshOptions);
setInterval(
Copy link
Member

Choose a reason for hiding this comment

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

@powerivq do you think this should be in a vsync?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, that would be better. I do not think we do setInterval in the code base.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@powerivq @erwinmombay
Hey, guys. I don't understand how in this case launch again function after timeout. Could u help me, also it was before I just moved to one utils file

Copy link
Member

Choose a reason for hiding this comment

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

@andreyYatskov could you explain why you need interval here? I don't fully understand why showInUnitAd needs to be repeatedly called

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so, here we are show an ad on the same place where unit and cover it, so this is making by some interval apprx each 30sec or 1 min

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@powerivq hey, it was before in another file I just moved to one utils https://github.com/ampproject/amphtml/pull/39814/files#diff-37f33fea038b529eea9fcd8ea1b6a593c41299791d08a2069647f127e55bf253. Also there no possibility that player will be destroyed.

So basically showInUnitAd creating covered background and showing an ad and then hide and should repeat this periodically

Copy link
Contributor

Choose a reason for hiding this comment

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

@andreyYatskov AMP runtime does resource recycling and will destroy things in order to reuse the runtime. Therefore, components should clean up the states when they are being destroyed. Here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, @powerivq so what u propose to apply? cause I'm not so familiar with amphtml and don't know the best practice and don't have an idea how to implement periodically appearing/hiding an element

Copy link
Contributor

@powerivq powerivq Mar 7, 2024

Choose a reason for hiding this comment

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

@andreyYatskov setInterval is okay. You just need to remove the interval by calling clearInterval in your unlayoutCallback.

Copy link
Member

Choose a reason for hiding this comment

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

agree here, as long as we do cleanup i'd be ok with the change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants